The name is mangled, and your declaration cannot find it.
http://msdn.microsoft.com/mobility/u...binpinvoke.asp
--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net
"AkeK" <(E-Mail Removed)> wrote in message
news:E9BE8C4A-21BC-4A31-8EC1-(E-Mail Removed)...
>
> The dumpbin /exports give me:
> 10 9 0000100F ?Msr3000_Open@@YAKPAG00PAX@Z
>
> It dont say me a thing!
>
> The following call give me "A managed InvalidCastException":
>
> <DllImport("msr8800.dll", CallingConvention:=CallingConvention.Winapi, _
> CharSet:=CharSet.Unicode, EntryPoint:="Msr3000_Open")> _
> Public Shared Function _
> Msr3000_OpenW(ByVal ptrSerialPort As Byte, ByVal ptrDllVersion As
Byte, _
> ByVal ptrFirmwareVersion As Byte, ByVal pPortHandle As Byte) As
UInt32
> End Function
>
> Public svar_open As UInt32
> Public svar_close As Int32
> Public szPort As String
> Public szDll As String
> Public szFirm As String
> Public szDummy As String
>
> Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
> szPort = "COM1:"
> svar = Form1.Msr3000_OpenW(szPort, szDll, szFirm, szDummy)
> svar_open = Form1.Msr3000_OpenW(szPort, szDll, szFirm, szDummy)
>
> Another question: How do you write the right path on Pocket PC 2003 for
msr8800.dll ?
>