c++dll中有这样一个方法:
GIS_API bool LT_Open(char* pPath);
C#调用部分:
[DllImport("LTGisEngine.dll", EntryPoint = "LT_Open", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]
private static extern bool LT_Open(string pPath);
public static bool LT_Open(string pPath)
{
bool bOper = false;
bOper = LT_OpenMap(pDataPath);
return bOper;
}用vs2010编写的测试程序,当C#程序调用XXX.LT_Open(@"D:\data\data\data");c++接收到的字符串为"D"
用vs2008编写的测试程序,当C#程序调用XXX.LT_Open(@"D:\data\data\data");c++接收到的字符串为"D:\data\data\data"求解为何?2010和2008对字符串的处理有不一样的地方吗?还是我有数据类型搞错了?谢谢各位!
GIS_API bool LT_Open(char* pPath);
C#调用部分:
[DllImport("LTGisEngine.dll", EntryPoint = "LT_Open", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]
private static extern bool LT_Open(string pPath);
public static bool LT_Open(string pPath)
{
bool bOper = false;
bOper = LT_OpenMap(pDataPath);
return bOper;
}用vs2010编写的测试程序,当C#程序调用XXX.LT_Open(@"D:\data\data\data");c++接收到的字符串为"D"
用vs2008编写的测试程序,当C#程序调用XXX.LT_Open(@"D:\data\data\data");c++接收到的字符串为"D:\data\data\data"求解为何?2010和2008对字符串的处理有不一样的地方吗?还是我有数据类型搞错了?谢谢各位!
我想知道这个函数LT_OpenMap(pDataPath);