Rapi.dll / OpenNETCF Invoke example

随声附和 提交于 2019-12-11 21:19:49

问题


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:


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)



来源:https://stackoverflow.com/questions/18332548/rapi-dll-opennetcf-invoke-example

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!