I have a Windows DLL written in C that I need to call in VB code. The
function has two parameters and must modify the character array for
just one of the parms. A simplified example of C code I wish to call
from test.dll is as follows:
__declspec(dllexport) void CopyString (char *in, char *out)
{
strcpy_s(out, strlen(in), in);
return;
}
My question is how do I call this from VB? Will I have to use an
IntPtr, a Char array, or something else? I know I must allocate memory
for the out parameter, but I would prefer to do this in my managed VB
code.
Will my declaration look like the following or something else?:
<System.Runtime.InteropServices.DllImport("test.dl l")_
Private Shared Sub CopyString(ByVal in As Char(), _
ByVal out As Char())
End Sub
TIA