vc 定义
typedef char *(CALLBACK *Func_Data)(long machineNo, UI2 fileIndex, UI4 addIndex, UI4 delIndex, UI2 recordCount, UI4 uploadedCount);
...
HANDLE CALLBACK StartListen(UI2 port
, Func_Data callback
);
...
if(callback!=NULL){
string result = callback(100, 1, 1, 1, 100, 0);
}c#:
public delegate string Func_Data(int machineNo, ushort fileIndex, uint addIndex, uint delIndex, ushort recordCount, uint uploadedCount);
不知道这样定义是否正确?为什么偶尔可以,但很多时候都会崩溃~~
typedef char *(CALLBACK *Func_Data)(long machineNo, UI2 fileIndex, UI4 addIndex, UI4 delIndex, UI2 recordCount, UI4 uploadedCount);
...
HANDLE CALLBACK StartListen(UI2 port
, Func_Data callback
);
...
if(callback!=NULL){
string result = callback(100, 1, 1, 1, 100, 0);
}c#:
public delegate string Func_Data(int machineNo, ushort fileIndex, uint addIndex, uint delIndex, ushort recordCount, uint uploadedCount);
不知道这样定义是否正确?为什么偶尔可以,但很多时候都会崩溃~~
我想问一下,c++ 里面 string 有没有大小限制?或其他什么要求?
我是怀疑定义是不是有问题~~而且 c# 里面的返回也很简单,里面的函数没有做任何处理;直接返回一个字符串也出错~~