Sign-up....

高手指点:这样的dll文件怎么调用

我知道dll文件中(c++编写)中有这样一个函数

bool deal(LPCTSTR A, int nIndex, LPCTSTR B, LPCTSTR C,DWORD D)

在vb中我准备好的A,B,C,D都是字符串,我怎么调用这个dll中的函数?如何声明并转化数据类型的定义?

[146 byte] By [msdn] at [2007-8-14 11:51:44]
# 1 Re: 高手指点:这样的dll文件怎么调用

Declare Function deal Lib "你的DLL文件名" (byval a as string,byval nIndex as integer,byval b as string,byval c as string,byval d as long)as boolean

不知这样行不

laihongbo524 at 2004-12-27 8:34:36 >
# 2 Re: 高手指点:这样的dll文件怎么调用

D是字符串的指针吧.

申明:

Declare Function deal Lib "deal.dll" (Byval A as String, Byval nIndex as long, Byval B as String, byval C as string, Byval D as Any) as boolean

调用:

ret=deal(A,nIndex,B,C,Byval D)

你试试

不过我不太明白你为什么在函数原型中将D定义为DWORD型,而调用时又传入字符串变量

CBean at 2004-12-27 11:35:27 >

VB

All Classified