using eVC dll from C#

  • Thread starter Thread starter Alessandro Cavalieri
  • Start date Start date
A

Alessandro Cavalieri

hi all,

I need to write a DLL using eVC4 (there is only one function in it) and call
it from C# but I receive the following message:

An unhandled exception of type 'System.MissingMethodException' occurred in
Socket.exe

the message seams to be clear but I'm sure that the exported function name
is correct and
the function is defined in C# as follow:

[DllImport("hmac_md5.dll", EntryPoint="hmac_md5")]
public static extern int hmac_md5(
ref Byte[] text, /* pointer to data stream */
int text_len, /* length of data stream */
ref Byte[] key, /* pointer to authentication key */
int key_len, /* length of authentication key */
ref Byte[] digest /* caller digest to be filled in */
);

note: I have a PXA250 processor (Toshiba e740) so I've copied the ARMV4I
version into the PPC application directory.

any idea about the error?

Thank in advance.
Alessandro
 
It could be that you've copied the wrong version of the DLL. You could try
ARMV4.

Most likely, though, the exported name of the function doesn't match what
you've set for EntryPoint there. You can use the dumpbin tool to see the
exported functions from the DLL. Note that, if you've used C++ (even if the
DLL source file names are .cpp), then, unless you've also declared the
export as extern "C", the name will be mangled to include information on the
function return and parameter data types.

Paul T.
 
I tried with ARMV4 but it still isn't working.
I checked the function name with dumpbin but it is correct (seems that
extern "C" is not necessary with eVC, true?)

I have a doubt, do I need to deploy some core dlls?? or better, how can I
compile a "static" dll?

Thanks for the answer,
Alessandro

Paul G. Tobey said:
It could be that you've copied the wrong version of the DLL. You could try
ARMV4.

Most likely, though, the exported name of the function doesn't match what
you've set for EntryPoint there. You can use the dumpbin tool to see the
exported functions from the DLL. Note that, if you've used C++ (even if the
DLL source file names are .cpp), then, unless you've also declared the
export as extern "C", the name will be mangled to include information on the
function return and parameter data types.

Paul T.

Alessandro Cavalieri said:
hi all,

I need to write a DLL using eVC4 (there is only one function in it) and call
it from C# but I receive the following message:

An unhandled exception of type 'System.MissingMethodException' occurred in
Socket.exe

the message seams to be clear but I'm sure that the exported function name
is correct and
the function is defined in C# as follow:

[DllImport("hmac_md5.dll", EntryPoint="hmac_md5")]
public static extern int hmac_md5(
ref Byte[] text, /* pointer to data stream */
int text_len, /* length of data stream */
ref Byte[] key, /* pointer to authentication key */
int key_len, /* length of authentication key */
ref Byte[] digest /* caller digest to be filled in */
);

note: I have a PXA250 processor (Toshiba e740) so I've copied the ARMV4I
version into the PPC application directory.

any idea about the error?

Thank in advance.
Alessandro
 
Use depends.exe to see what dependencies you have. eVC *does* still require
you use extern C if you use a .cpp file *unless* you also have a .def file

-Chris


Alessandro Cavalieri said:
I tried with ARMV4 but it still isn't working.
I checked the function name with dumpbin but it is correct (seems that
extern "C" is not necessary with eVC, true?)

I have a doubt, do I need to deploy some core dlls?? or better, how can I
compile a "static" dll?

Thanks for the answer,
Alessandro

Paul G. Tobey said:
It could be that you've copied the wrong version of the DLL. You could try
ARMV4.

Most likely, though, the exported name of the function doesn't match what
you've set for EntryPoint there. You can use the dumpbin tool to see the
exported functions from the DLL. Note that, if you've used C++ (even if the
DLL source file names are .cpp), then, unless you've also declared the
export as extern "C", the name will be mangled to include information on the
function return and parameter data types.

Paul T.

and
call
occurred
in
Socket.exe

the message seams to be clear but I'm sure that the exported function name
is correct and
the function is defined in C# as follow:

[DllImport("hmac_md5.dll", EntryPoint="hmac_md5")]
public static extern int hmac_md5(
ref Byte[] text, /* pointer to data stream */
int text_len, /* length of data stream */
ref Byte[] key, /* pointer to authentication key */
int key_len, /* length of authentication key */
ref Byte[] digest /* caller digest to be filled in */
);

note: I have a PXA250 processor (Toshiba e740) so I've copied the ARMV4I
version into the PPC application directory.

any idea about the error?

Thank in advance.
Alessandro
 
Back
Top