1)说明函数类型:
Type TVCvoidfunction=Function(......); Cdecl; //函数类型
Type TVCdwordfunction=Function(......); Cdecl; //函数类型
2)定义函数变量:
Var VCvoidfunction: TVCvoidfunction;
VCdwordfunction: TVCdwordfunction;
3、在Delphi程序中首先动态连接DLL:
DLL_Handle:=LoadLibrary(PChar(DLLPath));
DLL_Handle>0 Then //若加载成功,
Begin //则依次定位函数
Try
@VCvoidfunction :=GetProcAddress(DLL_Handle,'VCvoidfunction');
@VCdwordfunction:=GetProcAddress(DLL_Handle,'VCdwordfunction);
Except
FreeLibrary(DLL_Handle);
End
End