| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1015 人关注过本帖
标题:如何调用DLL中的CHAR
只看楼主 加入收藏
wyfandy
Rank: 1
来 自:深圳
等 级:新手上路
帖 子:376
专家分:0
注 册:2006-12-11
收藏
 问题点数:0 回复次数:4 
如何调用DLL中的CHAR

vc++原形如下(其中:version返回的版本信息):
int GetDeviceVersion ( int device , int devicegroup , char * version , int * len )  ;

在vb中,是:
Public Declare Function GetDeviceVersion Lib "ND80Driver.dll" Alias "_GetDeviceVersion@16" (ByVal device As Integer, ByVal devicegroup As Integer, Byref version As byte, ByRef len1 As Integer) As Integer

还是:
Public Declare Function GetDeviceVersion Lib "ND80Driver.dll" Alias "_GetDeviceVersion@16" (ByVal device As Integer, ByVal devicegroup As Integer, ByRef version As String, ByRef len1 As Integer) As Integer

或还是其它,请问他们又怎么调用呢?

搜索更多相关主题的帖子: CHAR DLL Integer int 
2007-05-11 10:11
wyfandy
Rank: 1
来 自:深圳
等 级:新手上路
帖 子:376
专家分:0
注 册:2006-12-11
收藏
得分:0 
怎么没有人回答呢?

不论什么事,只要认准了一个目标,然后朝之不懈地努力,就一定实现。编程爱好者QQ群:21318556
2007-05-13 20:16
hyhhd
Rank: 2
等 级:论坛游民
威 望:1
帖 子:502
专家分:44
注 册:2006-5-12
收藏
得分:0 
你可以都试试啊!
另外,在c中的“CHAR”是干什么的?

2007-05-13 20:23
Joforn
Rank: 6Rank: 6
等 级:贵宾
威 望:23
帖 子:1242
专家分:122
注 册:2007-1-2
收藏
得分:0 
Declare Function GetDeviceVersion Lib "*.dll"(byval device as integer,byval devicegroup as integer,version as any,Len1 as integer)as integer 'C中的字符串和VB中的字符串定义不一样,最好是用Byte数组代替,但VB中不能定义数组参数,只能用Any来代替,在调用时在使用数组指针。如:
Dim Byte1(255) as byte
GetDeviceVersion device,devicegroup,byval varptr(byte1(0)),len1

VB QQ群:47715789
2007-05-13 21:20
wyfandy
Rank: 1
来 自:深圳
等 级:新手上路
帖 子:376
专家分:0
注 册:2006-12-11
收藏
得分:0 
谢谢也可以用byte

Declare Function GetDeviceVersion Lib "*.dll"(byval device as integer,byval devicegroup as integer,byref version as byte,byref Len1 as integer)as integer 'C中的字符串和VB中的字符串定义不一样,最好是用Byte数组代替,但VB中不能定义数组参数,只能用Any来代替,在调用时在使用数组指针。如:
Dim Byte1(255) as byte
GetDeviceVersion device,devicegroup,byte1(0),len1

不论什么事,只要认准了一个目标,然后朝之不懈地努力,就一定实现。编程爱好者QQ群:21318556
2007-05-21 13:54
快速回复:如何调用DLL中的CHAR
数据加载中...
 
   



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

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