Microsoft .NET CF sample code not running

E

Eugen Feraru

The code I am running is the one provided by the Microsoft .NET CF book,
written by Andy Wigley.

I am trying to call unmanaged call functions from within .NET CF. If I
compile the provided samples I get the MissingMethodException.
If I use the already compiled unmanaged dll everything works fine.
Can the problem be related to the fact that the embedded VC ++ launches the
MS .NET CF 4.2 in the emulator, while the Studio .NET 2003 launches the MS
..NET CF 4.1?

Thanks,
Eugen
 
M

Maarten Struys, eMVP

The DLL, compiled with eVC must be available in the emulator in which your
managed application is running (the one started from within VS.NET). If the
DLL can not be found you typically get MissingMethodExceptions when you try
to P/Invoke to a native function. The easiest thing to do is build the DLL
using eVC and add the generated DLL as content in your managed project. You
can add the DLL to the project by right clicking on the project name in
solution explorer and selecting "Add existing item". In the dialog select
your dll. If you click the arrow that is part of the Open key on the dialog
you create a link to the DLL instead of creating a physical copy in your
managed project. If you now deploy your application to the emulator the DLL
will be deployed as part of the project to the emulator as well.

--
Regards,

Maarten Struys, eMVP
PTS Software bv

www.opennetcf.org | www.dotnetfordevices.com
 
E

Eugen Feraru

Thanks for your follow up.
I have already tried this and it does not work.
A little bit more background:
the samples provide two projects:
- evc 4.0 project, that provides a plain library of test methods
- VS 2003 CF device project: included the already compiled evc4.0
dll. The dll was added as content.

I am getting an error when I recompile the evc 4.0 project, and then replace
the already provided dll in the VS 2003 CF project. The dll gets deployed in
the emulator, as I can see it.
Any other insight is appreciated.

Eugen
 
E

Eugen Feraru

I've been able to identify the problem: it consists in vc++ 4.0 using the CE
4.2. By using the editbin to change the dll's version, the things start
working in the VS 2003 that uses a CE 4.1 emulator.
Thanks,
Eugen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top