我可以从完整的.Net Framework(在桌面上运行)调用非托管移动CE Dll吗
我有一个为 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能是错的,但我相信 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