c++-clivisual-c++-2013

Only handles can be created of a managed class. Why?


I am beginner for Visual C++ and currently just learning the concepts of it.

I came to know that there are 2 classes: Managed class & Value class.

  1. Value classes are like normal C++ classes, whose objects can be created which will hold the data.
  2. Managed classes are memory managed by garbage collector.

Questions:


Solution

  • It is not that you only create handles for managed classes, the instances (or objects) of the managed classes are created on the managed heap and you are given a handle to access that instance.

    The full answer is a wiki entry in it's own right, but I'll try give you an idea of what the issues here are;