首页
社区
课程
招聘
[求助]调用说dll无法定位入口点
发表于: 2009-4-13 16:18 7806

[求助]调用说dll无法定位入口点

2009-4-13 16:18
7806
我这有一个内蒙古的一个厂商提供的用调用的dll,我在VFp和delphi调用均出现无法定位接口点的提示,那位兄弟查调用dll,麻烦指教一下,看我哪儿错了.

这是说明书
01        函数名称:f_connect
        函数功能:连接新农合数据库(SQL Server 2000)
        参数列表:
        数据类型        参数名称        参数说明
        string        ls_ServerName        服务器名
        string        ls_LogId        用户名
        string        ls_LogPass        密码
        string        ls_Database        数据库名
        函数返回值:integer类型   1登记 0未登记 -1出错
02        函数名称:f_disconnect
        函数功能:断开新农合数据库的连接(SQL Server 2000)
        参数列表:无
        函数返回值:无

以下是我在VFP中的定义和调用:

        Declare f_connect        in "interface.dll" string @ls_ServerName,string @ls_LogId, string @ls_LogPass, string @ls_Database, integer @
        Declare f_disconnect     in "interface.dll" integer @

ls_ServerName="****"
ls_LogId="sa"
ls_LogPass=""
ls_Database="ld_xxnchzyl"
*连接数据库
        Re_value=f_connect(ls_ServerName,ls_ServerName,ls_LogPass,ls_Database)
*!*        *显示返回值
  =f_disconnect()

再下面是我在delphi中的调用:
var
itf:TCOClass_ld_interface;
i:integer;
begin
   itf:=TCOClass_ld_interface.create(nil);
   i:=itf.f_connect('*****,'sa','','ld_xxnchzyl');
//  close;
end;

QQ:86074731 如果哪个兄弟有空,请帮一下,在线等,我可以把这个库传过去,很小的.

[招生]系统0day安全班,企业级设备固件漏洞挖掘,Linux平台漏洞挖掘!

收藏
免费 0
支持
分享
最新回复 (10)
雪    币: 212
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
用 eXeScope.exe 查看一下该DLL  的 导出函数中是否有你要的这个函数
注意大小写
2009-4-13 19:44
0
雪    币: 152
活跃值: (15)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
C形式导出的函数名和CPP导出的函数名不一样,如果没有LIB文件的话,在声明函数的时候加上extern "C"试试
2009-4-13 20:11
0
雪    币: 152
活跃值: (15)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
i:=itf.f_connect('*****,'sa','','ld_xxnchzyl');

   QQ:86074731

我想,稍微社工你一下,你的数据库服务器就不保了。。。。。
竟然是SA连数据库
2009-4-13 20:13
0
雪    币: 7651
活跃值: (523)
能力值: ( LV9,RANK:610 )
在线值:
发帖
回帖
粉丝
5
同意楼上,楼主赶快把敏感信息抹了吧~~以前我也见过有人求助后台登录的错误原因,给出的错误信息中后台地址用户名密码竟然都有
2009-4-14 14:23
0
雪    币: 1889
活跃值: (198)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
6
没事儿,这只是测试数据库,正式数据库用户名和密码肯定改,再说,我们不连任何外网,内部用的.
2009-4-15 09:14
0
雪    币: 1889
活跃值: (198)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
7
interface; // PB90 generated typelib for: interface.dll

Dispatch Ild_interface;
GUID={7BE99889-EC6E-4835-97AD-3CA51615C704};
  function QueryInterface(riid:^GUID; out ppvObj:^^void);
  function AddRef: UI4;
  function Release: UI4;
  function GetTypeInfoCount(out pctinfo:^UINT);
  function GetTypeInfo(itinfo:UINT; lcid:UI4; out pptinfo:^^void);
  function GetIDsOfNames(riid:^GUID; rgszNames:^^I1; cNames:UINT; lcid:UI4; out rgdispid:^I4);
  function Invoke(dispidMember:I4; riid:^GUID; lcid:UI4; wFlags:UI2; pdispparams:^DISPPARAMS; out pvarResult:^variant; out pexcepinfo:^EXCEPINFO; out puArgErr:^UINT);
  function f_connect(ls_servername:BSTR; ls_logid:BSTR; ls_logpass:BSTR; ls_database:BSTR): I2;
  function f_disconnect;
  function f_checkclinic_in(ls_card_id:BSTR; ls_name:BSTR; ls_idcard:BSTR): I2;
  function f_getclinic_code(ls_card_id:BSTR; ls_name:BSTR; ls_idcard:BSTR): BSTR;
  function f_checkinhos_in(ls_card_id:BSTR; ls_name:BSTR; ls_idcard:BSTR): I2;
  function f_getinhos_code(ls_card_id:BSTR; ls_name:BSTR; ls_idcard:BSTR): BSTR;
  function f_getinhos_rcpcode(ls_inhos_code:BSTR): BSTR;
  function f_update_drug(ls_servername:BSTR; ls_logid:BSTR; ls_logpass:BSTR; ls_database:BSTR): I2;
  function f_update_item(ls_servername:BSTR; ls_logid:BSTR; ls_logpass:BSTR; ls_database:BSTR): I2;
  function f_import_inhosrcpmain(ls_inhos_code:BSTR; ls_rcp_code:BSTR; ldt_rcp_date:date; ls_crt_man:BSTR): I2;
  function f_import_clinicrcp(ls_clinic_code:BSTR; li_sn:I4; ls_clinic_type:BSTR; ls_item_code:BSTR; ls_item_jm:BSTR; ls_item_name:BSTR; ls_item_spec:BSTR; ls_item_dosage:BSTR; ls_item_unit:BSTR; ldc_item_price:R8; li_item_num:I2; ldc_item_fee:R8): I2;
  function f_import_inhosrcp(ls_inhos_code:BSTR; ls_rcp_code:BSTR; li_sn:I4; ls_rcp_type:BSTR; ls_item_code:BSTR; ls_item_jm:BSTR; ls_item_name:BSTR; ls_item_spec:BSTR; ls_item_dosage:BSTR; ls_item_unit:BSTR; ldc_item_price:R8; li_item_num:R8; ldc_item_fee:R8; ls_item_date:BSTR): I2;

Class COClass_ld_interface; // PowerBuilder 9.0.1 generated object
GUID={FD43E78A-BE9E-4891-8AA3-34AEDB6584BF};
  function QueryInterface(riid:^GUID; out ppvObj:^^void);
  function AddRef: UI4;
  function Release: UI4;
  function GetTypeInfoCount(out pctinfo:^UINT);
  function GetTypeInfo(itinfo:UINT; lcid:UI4; out pptinfo:^^void);
  function GetIDsOfNames(riid:^GUID; rgszNames:^^I1; cNames:UINT; lcid:UI4; out rgdispid:^I4);
  function Invoke(dispidMember:I4; riid:^GUID; lcid:UI4; wFlags:UI2; pdispparams:^DISPPARAMS; out pvarResult:^variant; out pexcepinfo:^EXCEPINFO; out puArgErr:^UINT);
  function f_connect(ls_servername:BSTR; ls_logid:BSTR; ls_logpass:BSTR; ls_database:BSTR): I2;
  function f_disconnect;
  function f_checkclinic_in(ls_card_id:BSTR; ls_name:BSTR; ls_idcard:BSTR): I2;
  function f_getclinic_code(ls_card_id:BSTR; ls_name:BSTR; ls_idcard:BSTR): BSTR;
  function f_checkinhos_in(ls_card_id:BSTR; ls_name:BSTR; ls_idcard:BSTR): I2;
  function f_getinhos_code(ls_card_id:BSTR; ls_name:BSTR; ls_idcard:BSTR): BSTR;
  function f_getinhos_rcpcode(ls_inhos_code:BSTR): BSTR;
  function f_update_drug(ls_servername:BSTR; ls_logid:BSTR; ls_logpass:BSTR; ls_database:BSTR): I2;
  function f_update_item(ls_servername:BSTR; ls_logid:BSTR; ls_logpass:BSTR; ls_database:BSTR): I2;
  function f_import_inhosrcpmain(ls_inhos_code:BSTR; ls_rcp_code:BSTR; ldt_rcp_date:date; ls_crt_man:BSTR): I2;
  function f_import_clinicrcp(ls_clinic_code:BSTR; li_sn:I4; ls_clinic_type:BSTR; ls_item_code:BSTR; ls_item_jm:BSTR; ls_item_name:BSTR; ls_item_spec:BSTR; ls_item_dosage:BSTR; ls_item_unit:BSTR; ldc_item_price:R8; li_item_num:I2; ldc_item_fee:R8): I2;
  function f_import_inhosrcp(ls_inhos_code:BSTR; ls_rcp_code:BSTR; li_sn:I4; ls_rcp_type:BSTR; ls_item_code:BSTR; ls_item_jm:BSTR; ls_item_name:BSTR; ls_item_spec:BSTR; ls_item_dosage:BSTR; ls_item_unit:BSTR; ldc_item_price:R8; li_item_num:R8; ldc_item_fee:R8; ls_item_date:BSTR): I2;
2009-4-15 09:17
0
雪    币: 1889
活跃值: (198)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
8
顶一下吧,还是没有解决
2009-4-17 13:37
0
雪    币: 1889
活跃值: (198)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
9
如果用delphi,VB或VFp调用之个dll里的函数,如何定义
上传的附件:
2009-4-17 14:16
0
雪    币: 212
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
没有定义导出函数,别人自然无法调用
2009-4-17 14:25
0
雪    币: 196
活跃值: (135)
能力值: ( LV10,RANK:170 )
在线值:
发帖
回帖
粉丝
11
f_connect是个接口函数,只要有对就应的接口类型就可以调用了.

对VFP与 DEPHI不熟,看不出哪里有错,VC 的使用步骤如下:
int main()
{
	HRESULT hr;
	IAtlTest *ppv;
	DWORD dwClsContext = CLSCTX_INPROC_SERVER ;

	// 初使化COM库
	hr = ::CoInitialize(NULL);
	if(SUCCEEDED(hr))
		cout<<"初使化成功!按 回车 继续..."<<endl;
	getchar();

	// 取得IAtlTest接口接针
	hr = ::CoCreateInstance(CLSID_AtlTest,NULL,dwClsContext,IID_IAtlTest,(void **)&ppv);
	if(SUCCEEDED(hr))
		cout<<"得到IAtlTest成功!按 回车 继续..."<<endl;
	else
	{
		cout<<"获取失败,按 回车 退出!"<<endl;
		::CoUninitialize();
		getchar();
		return 0;
	}
	getchar();

	ppv->Test1();   // 调用接口函数
	ppv->Test2();

	cout<<"按 回车 以释放COM组件..."<<endl;
	ppv->Release(); // 释放COM组件

	::CoUninitialize();
	getchar();
	return 0;
}
2009-4-17 14:53
0
游客
登录 | 注册 方可回帖
返回
//