So I had a c++ .dll that I wanted to use in my vb.net program. I was told that
this was the header
extern “C” __declspec(dllimport)void getPassword(char *inputString, char *outputString);
After much reading/researching/testing I finally got this to work.
Imports System.Runtime.InteropServices
Imports System.Text
<DllImport(“c:\\Password.dll”)> _
Public Shared Sub getPassword(ByVal inputString As StringBuilder, ByVal outputString As StringBuilder)
Dim input As String = “testing”
Dim result As New StringBuilder
Dim send As New StringBuilder(input)
getPassword(send, result)
MsgBox(result.ToString)
The trick was using the StringBuilders for the Char*