function VsppCommInit(nPort:Dword;key:Dword):Dword;stdcall;external 'D:\delphi\IVR_gateway\SpServer.dll';编译的时候,系统提示"开法定位程序输入点VsppCommInit于动态链接库D:\delphi\IVR_gateway\spserver.dll上"
动态链接库是有这个函数的。并且路径也是正确的。
不知到底哪错了。。望大侠们指点迷津
动态链接库是有这个函数的。并且路径也是正确的。
不知到底哪错了。。望大侠们指点迷津
Const
DllName='SpServer.dll'
function VsppCommInit(nPort:Dword;key:Dword):Dword;stdcall;
//实现
implementation
function VsppCommInit;external DLLName name 'VsppCommInit';1、检查函数名,确保函数声明和原型一致(大小写?)
2、检查函数参数。
3、载入的动态链接库不要用绝对地址。只需要声明dll名,程序会自动在当前目录、系统变量path列出的目录中寻找。建议:看看windows中的函数声明,再和windowsSDK的文档对比,大概就明白了。
开始我也这样认为,我用viewdll.exe 程序查看.
与里面的函数名是相同的.
我今天用C++按照你的函数原型写了个DLL,在Delphi中按照我的调用方式没有任何问题啊。
老大,你delphi 怎么写的.
Email:[email protected]
谢谢 exu
var
Comminit_sta1:LongWord;
begin
Comminit_sta1:=VsppCommInit_S(8887,1);
// showmessage(inttostr(Comminit_sta1));
end;一运行就出说地址访问错误.
"Access violation at address 00CD62AF Write of address 00000000"
function VsppCommInit_S(nPort:DWord;key:Dword):DWord;stdcall;external 'SpServer.dll' name 'VSPPCommInit';stdcall;
"Access violation at address 00CD62AF Write of address 00000000"