找不到,在Windows Mobile的PInvoke DLL错误 [英] Can't find PInvoke DLL error in Windows Mobile

查看:490
本文介绍了找不到,在Windows Mobile的PInvoke DLL错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多的麻烦得到一个基本方案的工作在Windows Mobile 5.0模拟器。我有一个WinForms应用程序,最终调用到本地code。部署工作正常,所有的本地DLL被复制到同一文件夹中的WinForms .exe文件。我也验证了这是与远程文件查看器工具的情况下。

I am having a lot of trouble getting a basic scenario to work on windows mobile 5.0 emulator. I have a winforms app that eventually calls into native code. Deployment works fine and all the native DLLs are copied in the same folder as the winforms .exe. I also verified this is the case with Remote File Viewer tool.

然而,当我启动我的应用程序,它总是失败,无法找到PInvoke的DLL - System.MissingMethodException错误(在时机成熟时调入本地code,DllImport属性是毫无用处)。我的知道的是,本机DLL是在同一文件夹中的可执行文件中。还有什么应该怎么办?

However when I launch my app, it always fails with "Can't find PInvoke dll -- System.MissingMethodException" error (when the time comes to call into native code, the DllImport attribute is rendered useless). I know that the native dll is found in the same folder as the executable. What more should I do?

我使用VS 2008。

I am using VS 2008.

推荐答案

要延长Jared的答案,四更常见的原因获得的MissingMethodException,而P /调用在CF:

To extend Jared's answer, four more common reasons to get a MissingMethodException while P/Invoking in the CF:

  1. 您缺少的依赖你调用到机库的
  2. 本机assmebly被编为错误的子系统(如台式机,不符合CE)
  3. 本机的组装编译的错误处理器(即x86和ARM没有)
  4. 您没有足够的虚拟内存的DLL加载。
  1. You are missing dependencies of the native library you are calling into.
  2. The native assmebly was compiled for the wrong subsystem (i.e. desktop, not CE)
  3. The native assembly was compiled for the wrong processor (i.e. x86 and not ARM)
  4. You don't have enough virtual memory for the DLL to load.

你有没有验证的DLL入口点是未经修饰的东西,如 DUMPBIN

Have you verified the DLL entry points are undecorated with something like dumpbin?

这篇关于找不到,在Windows Mobile的PInvoke DLL错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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