当前位置: 代码迷 >> Delphi >> Delphi调用VC++的动态库有关问题
  详细解决方案

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

热度:5421   发布时间:2013-02-26 00:00:00.0
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';
  相关解决方案