Embedded EVc dll calls from vb.net

M

merco

hi, i have a EVc DLL with a simple method:
PROVADLL_API int fnProvaDll(void)
{
return 42;
}

i'm trying to call it from with vb with this declare...
Declare Function fnProvaDLL Lib "ProvaDLL.dll" Alias
"?fnProvaDll@@YAHXZ" () As Int32

I use that alias because with "dumpbin" i see:
Section contains the following exports for ProvaDll.dll

00000000 characteristics
4385B9E1 time date stamp Thu Nov 24 14:02:25 2005
0.00 version
1 ordinal base
5 number of functions
5 number of names

ordinal hint RVA name

1 0 00001054 ?COMClose@@YAXXZ
2 1 00001010 ?COMOpen@@YAPAJPAG@Z
3 2 00001080 ?Echo@@YAPAGPAG@Z
4 3 00001008 ?fnProvaDll@@YAHXZ
5 4 00003084 ?nProvaDll@@3HA


but i always get a "NotSupportedException" even if i use the ordinal
"#4".
The same DLL works OK with a sample test program written in EVc.

Some suggestions ?
 
G

Guest

extern the function so it's name doesn't get mangled. Make sure it's
compiled for the right processor.

-Chris
 
M

merco

thanks,
now the functions are named OK
File Type: DLL

Section contains the following exports for ProvaDll.dll

00000000 characteristics
4386C6DD time date stamp Fri Nov 25 09:10:05 2005
0.00 version
1 ordinal base
5 number of functions
5 number of names

ordinal hint RVA name

1 0 00001054 COMClose
2 1 00001010 COMOpen
3 2 00001080 Echo
4 3 00001008 fnProvaDll
5 4 00003084 nProvaDll

but not i get a "MissingMethodException" both using "fnProvaDll" and
"#4" in declaration (also using DLLImport)...
What can I do ?
 
M

merco

yes, i used the emulator and didn't work.

Now i use the real device and it's all ok.
thanks
 

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