------解决方案-------------------- 哇 什么代码哎.. [DllImport("pr2.dll")] extern int PR2MagReadTrack2(int hDev,int n,string RecData);
使用的时候, int ret = PR2MagReadTrack2(123,32,"fhnsandf");
------解决方案-------------------- [DllImport("pr2.dll")] extern int PR2MagReadTrack2(int hDev,int n,string RecData); 使用的时候 int ret = PR2MagReadTrack2(123,32,"fhnsandf");
恩这样就行了
------解决方案--------------------
C# code
[DllImport("pr2.dll")]
extern int PR2MagReadTrack2(int hDev,int n, [out] [MarshalAs(UnmanagedType.LPStr)] string RecData);
使用的时候
string OO;
int ret = PR2MagReadTrack2(123,32,OO);
------解决方案-------------------- 顶一楼
------解决方案--------------------
C# code[DllImport("pr2.dll")] extern int PR2MagReadTrack2(int hDev,int n, out [MarshalAs(UnmanagedType.LPStr)] string RecData); 使用的时候 string OO; int ret = PR2MagReadTrack2(123,32,out OO);
------解决方案--------------------