To pass string between VC DLL and VB, please refer to the article below:Q187912 HOWTO: Pass a String Between Visual Basic and Your C DLL http://support.microsoft.com/support/kb/articles/q187/9/12.aspQ118643 How to Pass a String or String Arrays Between VB and a C DLL http://support.microsoft.com/support/kb/articles/q118/6/43.asp
vc中必须声明为stdcall,字符串用LPCSTR不用char*int __stdcall func(int ff,LPCSTR pointer,int yy);vb中字符串用byval不用byref...fun(byval ff as integer, byval pointer as string, byval yy as integer) as integer;
Extern "C" _declepce(dllexport)int WINAPI func(int ff,LPTSTR pointer,int yy); //使用 WINAPI 标志是必要的,不然VB无法识别 声明: Private Declare Function funcLib "youdll.dll" (ByVal ff As Long,ByVal pointer As String,ByVal yy As Long) As Long
article below:Q187912 HOWTO: Pass a String Between Visual Basic and Your C DLL
http://support.microsoft.com/support/kb/articles/q187/9/12.aspQ118643 How to Pass a String or String Arrays Between VB and a C DLL
http://support.microsoft.com/support/kb/articles/q118/6/43.asp
//使用 WINAPI 标志是必要的,不然VB无法识别
声明:
Private Declare Function funcLib "youdll.dll" (ByVal ff As Long,ByVal pointer As String,ByVal yy As Long) As Long