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

Re: MissingMethodException by Alex

Alex
Fri Nov 12 01:50:17 CST 2004

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
---
Visit http://www.opennetcf.org
"Keven Corazza" <KevenCorazza@discussions.microsoft.com> wrote in message
news:E5C084AD-6920-4CDB-92F2-FE201430E687@microsoft.com...
> 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
>
>
>
>
>
>
>



Re: MissingMethodException by KevenCorazza

KevenCorazza
Fri Nov 12 02:09:02 CST 2004

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

"Alex Feinman [MVP]" wrote:

> 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
> ---
> Visit http://www.opennetcf.org
> "Keven Corazza" <KevenCorazza@discussions.microsoft.com> wrote in message
> news:E5C084AD-6920-4CDB-92F2-FE201430E687@microsoft.com...
> > 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
> >
> >
> >
> >
> >
> >
> >
>
>
>

Re: MissingMethodException by Alex

Alex
Fri Nov 12 02:48:56 CST 2004

Keven,

Why don't you take a look at the sample project here
http://www.alexfeinman.com/download.asp?doc=VBInteropEmu.zip and see if you
are doing something differently. My guess is that you are still missing
extern "C" in your .h file

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Keven Corazza" <KevenCorazza@discussions.microsoft.com> wrote in message
news:65BACD47-17EB-4264-8E2B-0824530EADED@microsoft.com...
> 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
>
> "Alex Feinman [MVP]" wrote:
>
>> 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
>> ---
>> Visit http://www.opennetcf.org
>> "Keven Corazza" <KevenCorazza@discussions.microsoft.com> wrote in message
>> news:E5C084AD-6920-4CDB-92F2-FE201430E687@microsoft.com...
>> > 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
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>>



Re: MissingMethodException by KevenCorazza

KevenCorazza
Fri Nov 12 10:20:07 CST 2004

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

"Alex Feinman [MVP]" wrote:

> Keven,
>
> Why don't you take a look at the sample project here
> http://www.alexfeinman.com/download.asp?doc=VBInteropEmu.zip and see if you
> are doing something differently. My guess is that you are still missing
> extern "C" in your .h file
>
> --
> Alex Feinman
> ---
> Visit http://www.opennetcf.org
> "Keven Corazza" <KevenCorazza@discussions.microsoft.com> wrote in message
> news:65BACD47-17EB-4264-8E2B-0824530EADED@microsoft.com...
> > 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
> >
> > "Alex Feinman [MVP]" wrote:
> >
> >> 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
> >> ---
> >> Visit http://www.opennetcf.org
> >> "Keven Corazza" <KevenCorazza@discussions.microsoft.com> wrote in message
> >> news:E5C084AD-6920-4CDB-92F2-FE201430E687@microsoft.com...
> >> > 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
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
>
>
>