title: Declare and <DllImport> in VB.NET have different results
body: <p>I've been trying to call a login method of an unmanaged DLL.</p>
  
  <p>If I use Declare the login fails.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>If I use DllImport, it works !!</p>
  
  <pre><code>    &lt;DllImport("dllCore.dll", 
                  EntryPoint:="Login", 
                  SetLastError:=True, 
                  CharSet:=CharSet.Unicode, 
                  ExactSpelling:=True, 
                  CallingConvention:=CallingConvention.StdCall)&gt; 
          Private Function Login(ByVal username As String, ByVal password As String) As Integer
          End Function
  
  Login ("Steve", "123456") ' NOW WORKS 
  </code></pre>
  
  <p>Has anyone any ideas why I get this behaviour ??</p>