vb调用vc写的dll, 关于字符指针传递的问题!!!急!! 请大家帮忙!!!!
VC中是这么声明的:
#define VCVB_API extern"C" __declspec(dllexport)
VCVB_API void __stdcall VC2VB(char *pString)
{
pString = "china";
}
VB中是这样的:
Option Explicit
Private Declare Sub VC2VB Lib "vbvcdll.dll" (ByVal pString As String)
Private Sub Command1_Click()
Dim strSource As String
strSource = String(10, 0)
VC2VB strSource
Me.AutoRedraw = True
Print strSource '如果正确应该输出的是china
End Sub
但是结果总是不对, strSource 还是空的.
请问大家,这个是怎么回事? 请大家帮忙!
多谢!!!!!!!!!!!!!!!!!!!!!!!!!!!