我正在尝试在VB.NET中调用C ++函数,它会引发PInvokeStackImbalance。这是C ++函数签名:
int e1v151(char *NoUsager, char *SequentielSDU, char *code_sys, int code_for, char *IndGest2)
在这里,在VB.NET中:
DllImport("E1fnbase.dll", EntryPoint:="e1v151", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Ansi)>
Public Function e1v151(ByVal NoUsager As String, ByVal SeqSDU As String, ByVal Codesys As String, ByVal CodeFor As Integer, ByVal IndGest2 As String) As Integer
End Function
我已尝试过一些事情(使用StringBuilder
代替String
,<MarshalAs(LPStr)>
)但没有任何成功。有没有我看不到的东西?