アンマネージ DLL のログイン メソッドを呼び出そうとしています。
Declare を使用すると、ログインに失敗します。
Private Declare Function Login Lib "dllCore" (ByVal lpName As String, ByVal lpPassword As String) As Int32
Login ("Steve", "123456") ' THIS FAILS TO LOGIN ALTHOUGH THE PARAMS ARE CORRECT
DllImport を使用すると動作します !!
<DllImport("dllCore.dll",
EntryPoint:="Login",
SetLastError:=True,
CharSet:=CharSet.Unicode,
ExactSpelling:=True,
CallingConvention:=CallingConvention.StdCall)>
Private Function Login(ByVal username As String, ByVal password As String) As Integer
End Function
Login ("Steve", "123456") ' NOW WORKS
なぜ私がこの振る舞いをするのか、誰にもアイデアがありますか??