关于向API函数传递参数的问题~~~
函数原型太长,现在先贴个测试版本~~~
'DLL中输出函数的原形
'-1:
'void WINAPI HelloWorld (char *prompt,char * title)
'{
' MessageBox (0, prompt, title, MB_ICONINFORMATION);
'}
'VB中的声明:
Private Declare Sub HelloWorld Lib "tasm.dll" (ByVal prompt As String, ByVal title As String)
'函数调用: 'Call HelloWorld("Hello world", "Hi") '这里是成功的~~~~~!!!!!
下面把函数改成数组,其参数应该怎么传递,,,,谢谢,,,,在线等!!!!
'-2:
' void WINAPI HelloWorld (int c,char **prompt)
'{
' int i;
' char buf[1024];
' memset(buf,0,1024);
' for (i=1;i<c;i++)
' strcat(buf, prompt);
' MessageBox (0, buf, prompt[0], MB_ICONINFORMATION);
'}
函数声明:Private Declare Sub HelloWorld Lib "tasm.dll" (ByVal iCount As Long, prompt() As String)
函数调用:(下面的调用代码是不可行的,请教如何传递,,,我已经试过很多种方法了)
Dim prompt(3) As String
prompt(0) = " hello"
prompt(1) = " yun"
prompt(2) = " Hi"
prompt(3) = " finish"
HelloWorld 3&, prompt