Rapi.dll/OpenNETCF 调用示例 [英] Rapi.dll / OpenNETCF Invoke example

查看:28
本文介绍了Rapi.dll/OpenNETCF 调用示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用 OpenNETCF Rapi.dll 的 Invoke 方法.有人可以发布一个例子吗?我似乎无法在网络上的任何地方找到.其他函数调用工作正常,但我无法弄清楚 Invoke.(dllPath 没问题)

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 位于 CE 设备的根目录中.
  • 它有一个需要一个字符串参数的 FindAndKill 方法

我已经试过了:

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();

推荐答案

您需要调试以确定发生了什么.添加对 DllMain 和方法的 ::MessageBox 调用,以查看 DLL 是否正在加载以及是否正在调用该方法.如果不是,请确保您的方法是从 DLL 公开导出的,并且名称没有被破坏(dumpbin 是一个很好的工具)

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)

这篇关于Rapi.dll/OpenNETCF 调用示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆