VB 如何将string转换为LPSTR?

我在VB中调用一个dll,dll中函数为long msg(LPSTR str),我如何将在VB中定义的string类型的参数转换为LPSTR传递到DLL函数中?

VB中声明函数的时候用ByVal:
Declare Function msg Lib "xxx.dll"(ByVal str As String) As Long
使用的时候:
dim a as string
a="参数"
call msg(a)
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-11-15
你这样试试,
DIM A AS string
A=****
long msg(A)
相似回答