读书人

Delphi调用VC++的动态库有关问题

发布时间: 2013-02-17 10:44:46 作者: rapoo

Delphi调用VC++的动态库问题
VC++给的动态库函数说明

/******************************************************************************
* Function:HV_OpenDevice
* Description: 打开设备
* Format:
* HRESULT HV_OpenDevice(int nDevId) ;
* Params:
* int nId: 设备索引
* Return:
* HV_SUCCESS: 成功; HV_NO_SUCH_DEVICE: 未找到
******************************************************************************/
HVGIGE_WP_API HRESULT __stdcall HV_OpenDevice(int nDevId);


我的调用方式
function HV_OpenDevice(nDevId: Integer):Integer;stdcall;external 'HVGigE_WP.dll' name 'HV_OpenDevice';


哪里不对啊?

运行的时候直接就弹出提示:
无法定位程序输入点 HV_OpenDevice 于动态链接库 'HVGigE_WP.dll' 上

为什么? Delphi VC++动态库 调用
[解决办法]
有的c++编译器会自动在实际编译出的函数名前面加下划线。
可以depends攻击看一下那个dll实际输出的函数名是什么
[解决办法]
depends +1

[解决办法]
用工具查看一下函数名是不是不对
[解决办法]
引用:
Delphi/Pascal code?1function ?HV_OpenDevice@@YGJH@Z(nDevId: Integer):Integer;stdcall;external 'HVGigE_WP.dll' name 'HV_OpenDevice';

这样的??编译都通不过哎。。。

晕。。。。

function HV_OpenDevice(nDevId: Integer):Integer;stdcall;external 'HVGigE_WP.dll' name 'HV_OpenDevice@@YGJH@Z';

读书人网 >.NET

热点推荐