MissingMethodException

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I'm trying to call from C# a DLL function developed with eVC 3.0 and I
get the error MissingMethod Exception when I try to call the function.

I read all previous messages about this matter but I'm not able to solve the
problem.

I can say:

- the DLL is loaded because I put a message on DLLMain and I can see this
message; so the DLL is copied in the emulator and it is loaded.
- I've use "C" in the declaration of the DLL but with dependency walker I
don't see exactly the name of exported function but I see _Sierra@0 (the name
of the function is Sierra). I don't know if this is right or not.

Hoping in an answer...

Keven Corazza
 
You need to do two things:

1. Your function needs to be defined as WINAPI, e.g.
__declspec(dllexport) int WINAPI Sierra();

2. IN the .h file you need to define it as

extern "C" __declspec(dllexport) int WINAPI Sierra();

Alex Feinman
 
Thank you for yuor answer Alex but no luck. I declared the function as you
suggest but I get again MissingMethodException and with dependency walker the
name of the function is still _Sierra@0.

Any ideas ?

Keven
 
Thank you for your help Alex.

I finally discovered the problem: I think that when I've created a DLL I
made a mistake on choosing from the different options. My project settings
was different from the project setting of your example.

I've created the DLL from the beginning and now it works.

Thank you again.

Keven
 
Back
Top