我在VC6下写了一个函数,做成dll的形式。在VC下测试通过了,可是声明到PB9中后调用报错,错误如下:
Application terminated.
Error:Specified argument type differs from required argument type at runtime in DLL function crtpo.
(invalid stack pointer on return from function call)at line 16 ……
其中我在VC下编写DLL的代码如下
#include <windows.h>
#ifdef __cplusplus
extern "C"{
#endif
_declspec(dllexport) int crtpro(long strcom)
{
STARTUPINFO si;
si.cb = sizeof(si);
PROCESS_INFORMATION pi;
if (TRUE == CreateProcessA(NULL,(LPTSTR)strcom,NULL,
NULL,FALSE,NULL,
NULL,NULL,&si,&pi))
return 0;
else
return 1;
}
#ifdef __cplusplus
}
#endif
在PB中声明如下:
public Function integer crtpro(long str) library "mydll.dll"
实在不知道是哪里出错了,请大家帮忙分析下。多谢多谢
------解决方案--------------------
public Function long crtpro(long str) library "mydll.dll"
VC的INT是PB的LONG