PInvoke and MissungMethod exception

  • Thread starter Patrick Theobald
  • Start date
P

Patrick Theobald

hi all!!

I'm trying to invoke a function that is located in a C-coded Win32-dll.
I copied the dll into the \windows\ directory of the mobile device.
The declaration is quite simple and looks like this:

[DllImportAttribute("foodll.dll",EntryPoint="foo")]
internal static extern int foo(int h);

When I try to invoke the function

int ret = foo(1);

I get an MissingMethod exception.
I already checked the function names by using dumpbin.exe. They seem to be
ok.

What can do? Any cool tips?

Thank in advance,

Patrick Theobald
 
S

Sergey Bogdanov

Make sure that you compile foodll.dll for correct processor type:
* X86 for emulator
* ARM (maybe other) for your device
 
C

Chris Tacke, eMVP

You're not giving us enough info. Based on your comments it seems you're
fine, but we need to see the C declaration of the function and what
processor you've compiled it for.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 

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