Pointers to managed types as members of a __gc class

  • Thread starter Thread starter m
  • Start date Start date
M

m

Hi,
I'm reading Microsoft Visual C++ .NET Step by Step, Version 2003 and I found
a sentence it says :
"you can't have pointers to managed types as members of a __gc class.".

Why ?
Thanks,
Michele
 
Are you sure it doesnt' mean they can't be members of non __gc classes?
If you want one as a member of a non-gc class, you use

gcroot<MangedObject_c*> m_ManagedPointer;

In a __gc class, you just store them as normal pointers.

Cheers

Russell
 
Hi,
I'm just cutting and paste the exact text from the ebook ( Chapter 13 ) :

Note It would be neater to use a System::DateTime object to represent
the date of birth, but you can't have pointers to managed types as members
of a __gc class.



So I mean ... It could be an error ... I hope :)

BR,
Michele
 
m said:
Hi,
I'm just cutting and paste the exact text from the ebook ( Chapter 13 ) :

Note It would be neater to use a System::DateTime object to
represent the date of birth, but you can't have pointers to managed types
as members of a __gc class.



So I mean ... It could be an error ... I hope :)

This is an error. I don't have enough context to figure out what the author
was trying to convey.
 
Back
Top