Hos to convert string _gc* _gc* to wchat_t**

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am writing a wrapper class for a unmanaged c++ class, which has the method
signature,

Method(wchar_t** ppszValue)

Anyone please tell me, how to convert the string _gc* _gc* to wchat_t**

Thanks in advance
 
Hello Vinoth,

Assuming you want to get an unmanaged string from a String* (managed), I
think one of these methods from ( System.Runtime.InteropServices.Marshal
) might help you:

public static IntPtr StringToBSTR(string s);
public static IntPtr StringToCoTaskMemAnsi(string s);
public static IntPtr StringToCoTaskMemAuto(string s);
public static IntPtr StringToCoTaskMemUni(string s);
public static IntPtr StringToHGlobalAnsi(string s);
public static IntPtr StringToHGlobalAuto(string s);
public static IntPtr StringToHGlobalUni(string s);

Hope this helps,
RBischoff
-----------------------------------------
http://msdn.microsoft.com/visualc/ (VC++ HOME)
http://www.mvps.org/vcfaq/ (C++ FAQ)
http://www.winterdom.com/mcppfaq/ (MC++ FAQ)
http://msdn.microsoft.com/visualc/whidbey/ (CLI)

VK> Hi
VK>
VK> I am writing a wrapper class for a unmanaged c++ class, which has
VK> the method signature,
VK>
VK> Method(wchar_t** ppszValue)
VK>
VK> Anyone please tell me, how to convert the string _gc* _gc* to
VK> wchat_t**
VK>
VK> Thanks in advance
VK>
 
Back
Top