Code Snippet I : Wrapper for CLR string to native string marshalling
A frequent (too much frequent) need in Managed C++ is going from System::String objects to char* or wchar_t* strings. The boring side of the marshalling is that the memory allocated with the StringToHGlobalxxx functions should be freed with a matching call to FreeHGlobal. The solution is simple : using the power of C++ destructors we [...]
22 Aug