PInvoke and MissungMethod exception

  • Thread starter Thread starter Patrick Theobald
  • Start date 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
 
Make sure that you compile foodll.dll for correct processor type:
* X86 for emulator
* ARM (maybe other) for your device
 
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
 
Back
Top