VB下调用VCDLL函数,DLL中参数char*存在返回值,如何用VB调用呀,急!
VCDLL中函数原型如下:
int myfun(char* p1,const char* p2) 其中p2是需要返回一个字符串的。
在VC下调用时只需要:
char[10] p2;
myfun(&p1,p2);
p2可以正确返回我需要的字符串。
可是我在VB中将参数p2申明为:byval str as string
调用时:
dim p2 as string
myfun(p1,str(p2));或myfun(p1,p2);
运行时,察看p2的值却为空,而我需要得到的是VCDLL返回给p2的字符串。
请高手指教,是不是此处的参数p2需要申明为:byref str as string??