回调函数执行6次以后,结尾的时候报访问越界错误?求解了
每一次报错都是执行6次以后,然后跳出CPU的DEBUG界面,然后看不懂那个汇编指令,想请教一下,下面的什么意思,我摘抄一段
- Delphi(Pascal) code
mov ecx,[ebp+$08]; xor eax,eax cmp eax,[ecx+$04] //这句话报错 jnbe +$000000cb jb +$0c
出错的,不知道什么意思?请教大家了
[解决办法]
CVICALLBACK 你确定下它的定义是什么, 是cdecl 还是stdcall
#define CVICDECL __cdecl
/* CVICALLBACK is used for typdefs for ptrs to functions. For example:
* typedef void (CVICALLBACK * MenuDimmerCallbackPtr)(int menuBar, int panel);
*/
#define CVICALLBACK CVICDECL
我google的是这样定义的。
int32 DAQmxRegisterEveryNSamplesEvent (TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, uInt32 options, DAQmxEveryNSamplesEventCallbackPtr callbackFunction, void *callbackData);
这样应该就是C默认的cdecl , 不是STDCALL