从VB.NET调用C ++函数时引起的PInvokeStackImbalance

时间:2013-04-23 15:06:27

标签: c++ vb.net dllimport

我正在尝试在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)­>)但没有任何成功。有没有我看不到的东西?

0 个答案:

没有答案