I am new to C++ so I may be missing something. But doesn't using the new
syntax ^ instead of * for pointers and 'gcnew' instead of 'new' for example
make the code very non-portable to unmanaged C++, if the need ever arises?
Rasika.
PS. Is it possible to use managed assemblies from unmanaged code?
>I am new to C++ so I may be missing something. But doesn't using the new
> syntax ^ instead of * for pointers and 'gcnew' instead of 'new' for
> example
> make the code very non-portable to unmanaged C++, if the need ever arises?
Yes. But that is beside the point. Standard C++ does not provide for
automatic garbage collection. The new syntax is used for manipulating
grabage-collected objects on the managed heap.
Regards,
Will
> I am new to C++ so I may be missing something. But doesn't using the
> new syntax ^ instead of * for pointers and 'gcnew' instead of 'new'
> for example make the code very non-portable to unmanaged C++, if the
> need ever arises?
Yes.
> Rasika.
>
> PS. Is it possible to use managed assemblies from unmanaged code?
Yes. If the main program is unmanaged, you can use the .NET hosting APIs to
host the CLR and managed code in your unmanaged app. If the main program
can be managed, then VC++ can handle all the interop for you and you can mix
and match managed/unmanaged code pretty much as you see fit.
-cd
Rasika WIJAYARATNE - 06 Jul 2005 02:59 GMT
> and match managed/unmanaged code pretty much as you see fit.
Can you mix managed and unmanaged code within the same class using C++/CLI?
William DePalo [MVP VC++] - 06 Jul 2005 03:44 GMT
>> and match managed/unmanaged code pretty much as you see fit.
>
> Can you mix managed and unmanaged code within the same class using
> C++/CLI?
Yes, you can.
Regards,
Will
Rasika WIJAYARATNE - 06 Jul 2005 04:40 GMT
Thank you for your help.
> >> and match managed/unmanaged code pretty much as you see fit.
> >
[quoted text clipped - 5 lines]
> Regards,
> Will
Rasika WIJAYARATNE - 06 Jul 2005 04:41 GMT
Thanks for the information.
> > I am new to C++ so I may be missing something. But doesn't using the
> > new syntax ^ instead of * for pointers and 'gcnew' instead of 'new'
[quoted text clipped - 13 lines]
>
> -cd