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
Jochen Kalmbach [MVP] - 04 Jul 2005 09:46 GMT
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".

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/