C++ Interop, _gc Strings to _nogc char*

  • Thread starter Thread starter Urs Vogel
  • Start date Start date
U

Urs Vogel

Hi

Is there a similar method like Marshal::StringToHGlobalAnsi() by using an
existing pointer, rather than allocating memory and returning a new pointer?
My target buffers are persistent must must not be allocated every time when
converting from String to char*;

Thanks,
Urs
 
Hi Urs!
Is there a similar method like Marshal::StringToHGlobalAnsi() by using an
existing pointer, rather than allocating memory and returning a new pointer?
My target buffers are persistent must must not be allocated every time when
converting from String to char*;

You can use "WideCharToMultiByte" in conjuction with "PtrToStringChars".

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
Back
Top