有一个VC写的DLL文件,其中一个函数的参数为char[]类型,那么在VB中声明应该为什么类型呢?

这是函数原型int WINAPI zz_record_voxfile_async(int handle, char file_name[], unsigned short
mode)
我现在想在VB中使用。该如何声明?

Private Declare Function zz_record_voxfile_async Lib "r:\xx\debug\xx.dll" (ByVal handle As Long, ByVal file_name As String, ByVal mode As Integer) As Long

Private Sub Form_Load()
    zz_record_voxfile_async 11, "abcd中文 a在b在", 1
End Sub

 

如果DLL里面用的是UNICODE编码(WCHAR),那么VB中也还是使用string进行声明,传参的时候使用StrConv(string,vbUnicode)进行转换后再传递。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-08-29
vb中应该是string
相似回答