Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

Frank__Q

@Frank__Q
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Where is this managed object stored?
    F Frank__Q

    Thanks George. So, is there any way for a Native pointer to point to Managed Heap. I know this is not the correct thing to do but is it possible ? An example would be appreciated. I also think there is no way for a Handle (^) to point to native heap, is this correct ?

    Managed C++/CLI c++ data-structures dotnet question

  • Where is this managed object stored?
    F Frank__Q

    value class ValBase
    {
    public:
    int a;
    };

    ref class RefBase
    {
    public:
    int a;
    };

    int main(array ^args)
    {

    RefBase^ RefBase1 = gcnew RefBase; //LEGAL. Ref type Managed Obj created on CLR heap.
    ValBase^ ValBase1 = gcnew ValBase; //LEGAL. Value type Managed Obj created on CLR heap.

    RefBase* RefBase2 = new RefBase; //ILLEGAL: new cannot be used on Managed Ref Class
    ValBase* ValBase2 = new ValBase; //This compiles okay but where is this "Managed Object" stored ? CLR heap or Native heap ?

    }

    In the last assignment where is the managed object stored ? I am totally new to C++ CLI. Also, is it true that value types should use stack semantics to make code efficient ? i.e instead of ValBase^ ValBase1 = gcnew ValBase, I should just use ValBase ValBase1;

    Managed C++/CLI c++ data-structures dotnet question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups