Mark Ingram a écrit :
Hi, I've been trying to update some old C++ code and when i came across
this:
MyClass** ppOut
I changed it to:
MyManagedClass^% ppOut
"MyManagedClass^%" (tracking reference to a managed handle) is the
managed equivalent of "MyClass*&" (reference to a pointer). It is NOT
the equivalent of a pointer to a pointer.
However - it doesn't work exactly the same because I am unable to pass
nullptr for one of those parameters. How can I replicate pointers to
pointers?
You cannot do it directly, but on the other hand is shouldn't be
necessary in most cases. In native C and C++, pointers to pointers (to
pointers....) are mainly usefull for multi-dimensionnal arrays - which
are handled differently in managed code.
On the other hand, if you were using a pointer to a pointer in native
code as a function parameter, you should use the [Out] attribute
instead.
Show us the original code so that we can best advise you on how to
replace it.
Arnaud
MVP - VC
Thanks,