我可以从完整的.Net Framework(在桌面上运行)调用非托管移动CE Dll吗

发布于 2024-09-10 03:10:06 字数 2117 浏览 10 评论 0原文

我有一个为 Windows Ce 编译的非托管库。我试图从 VB.net Full Framework .Net 4 Client Profile Windows 应用程序调用此 dll。我正在尝试使用与 Compact Framework 应用程序中使用的代码相同的代码。它编译没有错误并运行,但是当调用函数时,我收到错误 ex = {“尝试加载格式不正确的程序。(来自 HRESULT 的异常:0x8007000B)”} 是否可以在桌面?这是我用来调用 Dll 的包装器代码:

Imports System
Imports System.Runtime.InteropServices

Module modM300CF

    Public Declare Function ParseBarCode Lib "M300LAP.dll" ( _
               ByVal P_track1 As Byte(), ByVal P_t1length As Short, _
               ByRef P_DLStatus As Short, _
               ByRef P_StateID As Byte, _
               ByRef P_DAge As Short, _
               ByRef P_CardName As Byte, _
               ByRef P_Address As Byte, _
               ByRef P_City As Byte, _
               ByRef P_State As Byte, _
               ByRef P_Zip As Byte, _
               ByRef P_DLNumber As Byte, _
               ByRef P_Expdate As Byte, _
               ByRef P_Bdate As Byte, _
               ByRef P_DLAlpha As Byte, _
               ByRef P_DHair As Byte, _
               ByRef P_DEyes As Byte, _
               ByRef P_DHeight As Byte, _
               ByRef P_DWeight As Byte, _
               ByRef P_DSex As Byte) As Short

    Public Declare Function ParseMagStripe Lib "M300LAP.dll" ( _
            ByVal P_track1 As Byte(), ByVal P_t1length As Short, _
            ByVal P_track2 As Byte(), ByVal P_t2length As Short, _
            ByVal P_track3 As Byte(), ByVal P_t3length As Short, _
            ByRef P_DLStatus As Short, _
            ByRef P_StateID As Byte, _
            ByRef P_DAge As Short, _
            ByRef P_CardName As Byte, _
            ByRef P_Address As Byte, _
            ByRef P_City As Byte, _
            ByRef P_State As Byte, _
            ByRef P_Zip As Byte, _
            ByRef P_DLNumber As Byte, _
            ByRef P_Expdate As Byte, _
            ByRef P_Bdate As Byte, _
            ByRef P_DLAlpha As Byte, _
            ByRef P_DHair As Byte, _
            ByRef P_DEyes As Byte, _
            ByRef P_DHeight As Byte, _
            ByRef P_DWeight As Byte, _
            ByRef P_DSex As Byte) As Short

End Module

I have an Unmanaged Lib compiled for Windows Ce. I am trying to call this dll from VB.net Full Framework .Net 4 Client Profile Windows application. I am trying to use the same code that I use in the Compact Framework application. It compiles without errors and runs but when Invoking a function I get error ex = {"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"} Is it possible to use the Mobile Unmanaged Dll on the Desktop ? Here is the Wrapper code I use to call the Dll:

Imports System
Imports System.Runtime.InteropServices

Module modM300CF

    Public Declare Function ParseBarCode Lib "M300LAP.dll" ( _
               ByVal P_track1 As Byte(), ByVal P_t1length As Short, _
               ByRef P_DLStatus As Short, _
               ByRef P_StateID As Byte, _
               ByRef P_DAge As Short, _
               ByRef P_CardName As Byte, _
               ByRef P_Address As Byte, _
               ByRef P_City As Byte, _
               ByRef P_State As Byte, _
               ByRef P_Zip As Byte, _
               ByRef P_DLNumber As Byte, _
               ByRef P_Expdate As Byte, _
               ByRef P_Bdate As Byte, _
               ByRef P_DLAlpha As Byte, _
               ByRef P_DHair As Byte, _
               ByRef P_DEyes As Byte, _
               ByRef P_DHeight As Byte, _
               ByRef P_DWeight As Byte, _
               ByRef P_DSex As Byte) As Short

    Public Declare Function ParseMagStripe Lib "M300LAP.dll" ( _
            ByVal P_track1 As Byte(), ByVal P_t1length As Short, _
            ByVal P_track2 As Byte(), ByVal P_t2length As Short, _
            ByVal P_track3 As Byte(), ByVal P_t3length As Short, _
            ByRef P_DLStatus As Short, _
            ByRef P_StateID As Byte, _
            ByRef P_DAge As Short, _
            ByRef P_CardName As Byte, _
            ByRef P_Address As Byte, _
            ByRef P_City As Byte, _
            ByRef P_State As Byte, _
            ByRef P_Zip As Byte, _
            ByRef P_DLNumber As Byte, _
            ByRef P_Expdate As Byte, _
            ByRef P_Bdate As Byte, _
            ByRef P_DLAlpha As Byte, _
            ByRef P_DHair As Byte, _
            ByRef P_DEyes As Byte, _
            ByRef P_DHeight As Byte, _
            ByRef P_DWeight As Byte, _
            ByRef P_DSex As Byte) As Short

End Module

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

未蓝澄海的烟 2024-09-17 03:10:06

我可能是错的,但我相信 Windows CE 上的二进制格式略有不同,这可能解释了为什么桌面 Windows 难以理解图像文件

I could be wrong but I believe the binary format is slightly different on Windows CE which might explain why desktop windows is having difficulty making sense of the image file

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文