c#调用C++时处理tchar *转字符串
时间:2014-02-21 02:41:14
收藏:0
阅读:891
C++的MYDll.dll中定义了
TCHAR* GetInfo (void)
在C#中引用
class CardRead
{
[DllImport("MYDll.dll")]
public static extern IntPtr GetInfo();
}
程序中调用
IntPtr Inf = CardRead.GetInfo();//调用
string Infstr = Marshal.PtrToStringAuto(Inf);//转字符串
原文:http://blog.csdn.net/shongyu/article/details/19559389
评论(0)