How can call a DLL function using GetProcAddress

G

Guest

I am developing a project where I made one DLL in Embedded C++ 4.0 with
determined functions that will be executed in one applicatory developed in C
# with SmartPhone 2003.


The order of the customer, I must carry through one LoadLibrary to load some
initial configurations. To have access these methods, I must use the
GetProcAddress to recoup the Handle of the methods. Until this point I obtain
all the necessary information but as I must execute the method that he is in
my DLL. It stows seeing the documentation of Microsoft and vi that I must use
the MethodInfo classroom to execute such method but I am not obtaining
results. Somebody would have some example.

Thanks for help
 
C

Chris Tacke, eMVP

Function pointers are not supported in the CF, so there's really no way to
do what I think you're trying to do. If you can't declare it with a
P/Invoke, you can't call it.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
P

Paul G. Tobey [eMVP]

You could create a shim DLL, also with eVC, and call *that* from your
managed code. The shim would load the library, get the address and call the
function, maybe returning an error, if the library couldn't be loaded or
whatever.

Paul T.
 
G

Guest

I found this method

MethodBase.GetMethodFromHandle().Invoke

But, this method, GetMethodFromHandle(), need a parameter of type
RuntimeMethodHandle Structure

How I use this Method?

I think that I can use this method for calling my DLL method. This is
possible or not??? If the ask is true, how can I use this method. Anybody had
a example for this method????

Thank so much for help

Mauricio
 
G

Guest

I thought we already established that you can't do this. You cannot call a
function pointer. The only workaround is to write an unmanaged shim as Paul
suggested.

-Chris
 

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