Hello,

I have a simple C DLL. This DLL have i compiled with VS2005 für Pocket/Arm.
Now i will test some function from a VB sample.

One C function is defined as
BOOL LslOnline(const char *szComm, BYTE a, BYTE b);
On PC VB i have add
Declare function LslOnline(ByVal szComm As String, ByVal a As Byte,
ByVal b As Byte) As Integer

But this does not work for VB / Pocket/Arm.
Why ?
How must i declare this for VB2005 Pocket/Arm ?

Thanks
Jimmy

Re: call C function from a DLL by Chris

Chris
Wed Apr 30 08:43:04 CDT 2008

Since WIndws CE is Unicode based, you likely need to add a MarshalAs
attribute to the first parameter (or you need to change the DLL). Also make
sure the name is not mangled.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Johann Obermayr" <Johann.Obermayr@sigmatek.at> wrote in message
news:OxuewfqqIHA.1164@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I have a simple C DLL. This DLL have i compiled with VS2005 für
> Pocket/Arm.
> Now i will test some function from a VB sample.
>
> One C function is defined as
> BOOL LslOnline(const char *szComm, BYTE a, BYTE b);
> On PC VB i have add
> Declare function LslOnline(ByVal szComm As String, ByVal a As Byte, ByVal
> b As Byte) As Integer
>
> But this does not work for VB / Pocket/Arm.
> Why ?
> How must i declare this for VB2005 Pocket/Arm ?
>
> Thanks
> Jimmy



Re: call C function from a DLL by Johann

Johann
Wed Apr 30 09:48:37 CDT 2008

Chris Tacke, eMVP schrieb:
> Since WIndws CE is Unicode based, you likely need to add a MarshalAs
> attribute to the first parameter (or you need to change the DLL). Also make
> sure the name is not mangled.
>
>
Thanks for help.
i will test, if it work with MarshalAs.
Changing DLL is at this time no option. Only if it does not work correct.

Jimmy