Rapi.dll / OpenNETCF Invoke example

1k views Asked by At

I'm failing to use the Invoke method of the OpenNETCF Rapi.dll. Can somebody please post an example? I can't seem to find one anywhere on the web. Other function calls worked fine, but I couldn't figure out Invoke. (dllPath was OK)

  • MyDll is in the root of the CE device.
  • It has a FindAndKill method which needs one string argument

I've tried this:

var rapi = new CODMrapi.CODMrapi(dllPath);
var encoding = new System.Text.UTF8Encoding();
rapi.Connect();
byte[] inputData = encoding.GetBytes(fileName);
byte[] outputData;
rapi.Connect();
rapi.Invoke("\\MyDll.dll", "FindAndKill", inputData, out outputData);
rapi.Disconnect();
1

There are 1 answers

0
ctacke On

You need to debug to determine what's happening. Add in ::MessageBox calls to the DllMain and the method to see if the DLL is even getting loaded and if the method is getting called. If they are not, make sure that your method is publicly exported from the DLL and the name wasn't mangled (dumpbin is a good tool for this)