| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3059 人关注过本帖
标题:dll 调用 问题,请帮忙
只看楼主 加入收藏
wcx_cc
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:52
帖 子:352
专家分:1152
注 册:2015-10-2
结帖率:92.86%
收藏
已结贴  问题点数:20 回复次数:8 
dll 调用 问题,请帮忙
dll.zip (166.65 KB)
个 dll 文件,是接口文件  vfp 9.0 一直调用不了,请帮忙!附上文件,看看怎样使用。用 craeteobject 也试过,但是需要注册,注册不了。用 declare integer  hisinterface in hiscomminterface.dll string input,string output
          hisinterface(input,output) 好像不行。

有 pb 的调用实例如下:
在PowerBuilder中,声明为FUNCTION int hisinterface(string input, string output) liabrary hiscomminterface.dll
调用时,首先给对应的各变量分配空间
例如,string input = Space(10000)
String output = Space(1000)
li_return = hisinterface (input, InHosNo)

vb 的调用实例如下:
Private Declare Function comminterface "hiscomminterface.dll" (ByVal input As string, ByVal output As string) As Integer
//定义变量
Dim input,output As string
//变量赋值(略)
//调用
GetPersonInfoLib(input, output)





   

[此贴子已经被作者于2019-5-27 01:45编辑过]

搜索更多相关主题的帖子: dll 调用 string input output 
2019-05-27 01:36
wcx_cc
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:52
帖 子:352
专家分:1152
注 册:2015-10-2
收藏
得分:0 
问题基本解决,使用了别名 .一块也介绍一下,如果用到这种调用的,可借签。
DECLARE integer hisinterface  in hiscomminterface.dll as diaoyong string ignput,string output
diaoyong(ignput,output)

diaoyong:是自己起的别名。
2019-05-27 04:51
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10538
专家分:42927
注 册:2014-5-20
收藏
得分:20 
“在PowerBuilder中,声明为FUNCTION int hisinterface(string input, string output) liabrary hiscomminterface.dll”
看了一下,hiscomminterface.dll只有一个导出函数comminterface(),语句是否写错了?
同样:
“Private Declare Function comminterface "hiscomminterface.dll" (ByVal input As string, ByVal output As string) As Integer”
......
GetPersonInfoLib(input, output)
这个GetPersonInfoLib函数在哪声明的?
2019-05-27 05:12
wcx_cc
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:52
帖 子:352
专家分:1152
注 册:2015-10-2
收藏
得分:0 
喜见吹佬又有回复!感谢感谢!
1楼帖子中的调用示例,是发布 dll 接口文件的软件公司搞的。很不明细,也可能是错的,一直让人耗费大量时间测试。个人认为有点不负责任。
 本人现在也想看见 hiscomminterface.dll 里有几个函数,现在不知道吹佬怎么查到的,需要继续请教。
通过2楼的办法,声明那个 hiscomminterface.dll,没出现错误提示,算是基本上能调用吧、但是,现在我发现还有很多问题。我的测试和遇到的问题如下:

新建一个空文件夹,里面只放入hiscomminterface.dll,他们提供很多其他的 dll 暂不放入。vfp 默认路径设到这个文件夹。运行下面代码,
 store 'aaa' to ignput,output
DECLARE integer hisinterface  in hiscomminterface.dll as diaoyong string ignput,string output
diaoyong(ignput,output)
   这时会有提示:‘无法启动此程序 eapagent.dll,因为计算机中丢失,尝试重新安装该程序以解决问题’,这时,我把eapagent.dll考进新建文件夹里,
重新运行上面代码,这个提示 eapagent.dll 的没了。
 但又出现同类提示 '无法启动此程序 hdcrw.dll,因为计算机中丢失,尝试重新安装该程序以解决问题’,这时,我又把 hdcrw.dll考进新建文件夹里,
重新运行上面代码,这个提示 hdcrw.dll 的没了。  ......  又出现了缺少文件的提示后,再将各个文件考进去。
 但是当到了提示缺少文件:MFCD42D.DLL,时,查找了他们提供的全部 dll 文件,根本没提供! 因此询问他们软件公司,但他们说用不到这个文件(脑子涨了)!
后来查询网上,说这是个 window 系统文件,并且提供了下载,下载后放进文件夹里,却出现了这样的提示:
 '在 dll 中找不到入口点 hisinterface',换了几个版本都不行。现在还没解决的!!谢谢!



  
2019-05-27 14:57
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10538
专家分:42927
注 册:2014-5-20
收藏
得分:0 
回复 4楼 wcx_cc
没用过MFC库,MFCD42D.DLL看似是用VC++的MFC库文件。
使用第三方开发的扩展库DLL,最好是参考开发方提供的相关使用手册。
2019-05-28 22:02
wcx_cc
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:52
帖 子:352
专家分:1152
注 册:2015-10-2
收藏
得分:0 
谢谢吹佬版主!我再查查看。不过有个重要的事要请教您: 非 Com 组件的 DLL 中含有的函数名,用什么方法可查看得到?这对于 正确调用 dll,太重要了。
部分Com 组件的 dll 的方法名并带参数,我能查看,但是 必须用  Declare 声明的还不能查到。


[此贴子已经被作者于2019-5-28 23:52编辑过]

2019-05-28 23:46
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10538
专家分:42927
注 册:2014-5-20
收藏
得分:0 
回复 6楼 wcx_cc
通常使用扩展函数库DLL一定要参考开发者提供的文档,凭DLL的导出函数名也很难正确调用此函数。
写个简单查看DLL导出函数名的小工具:
Export.rar (3.6 KB)
2019-05-29 05:08
wcx_cc
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:52
帖 子:352
专家分:1152
注 册:2015-10-2
收藏
得分:0 
这个输出函数的程序管用!!
2019-05-31 01:32
schtg
Rank: 12Rank: 12Rank: 12
来 自:https://t.me/pump_upp
等 级:贵宾
威 望:67
帖 子:1544
专家分:3003
注 册:2012-2-29
收藏
得分:0 
回复 7楼 吹水佬
这个很好,谢谢!
2019-05-31 05:42
快速回复:dll 调用 问题,请帮忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017186 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved