How to declare a managed variable as a member of a not-managed class?

R

René Estrella

I need to declared a managed variable as a member of a class that is not
managed. How can I do that? Please, don't say I have to declare the class
as a managed one, because I can't apply that solution. Please, give me
other solution. Thanks.
 
C

Carl Daniel [VC++ MVP]

René Estrella said:
I need to declared a managed variable as a member of a class that is
not managed. How can I do that? Please, don't say I have to declare
the class as a managed one, because I can't apply that solution.
Please, give me other solution. Thanks.

You have to use the gcroot template. See the <vcclr.h> header file, and
section 16.2, page 125 of the managed extensions document that's included
with VC++ (it's in your VC7 directory, in case you haven't located it).

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top