我有一个文件,该文件具有我需要使用的四个功能。 DLL函数文档为here。我尝试在VB.net中同时使用Lib
和Ruby-FFI的ffi_lib
加载DLL。两者都给我加载DLL的错误,但是我无法用来弄清为什么它无法加载DLL。如何确定为什么FFI(我首选的访问方法,但我也将接受VB.net)无法加载DLL?我在Windows和Mac上都尝试过。
可以通过here或通过在http://www.mscashdrawer.com/techcashdrawerUSB.php的支持页面上的第5号安装该DLL文件。这样将创建一个C:\ Program Files \ M-S Cash Drawer目录,其中将包含DLL文件。
Mac上的Ruby-FFI说
/Users/brandoncc/dev/open_cash_drawer/MSPOS_USB.dll: unknown file type, first eight bytes: 0x4D 0x5A 0x90 0x00 0x03 0x00 0x00 0x00
更新:我认为可能是因为dll是32位。以下是dumpbin的标题
Dump of file .\dev\open_cash_drawer\MSPOS_USB.dll
PE signature found
File Type: DLL
FILE HEADER VALUES
14C machine (x86)
4 number of sections
53978AFD time date stamp Tue Jun 10 14:47:25 2014
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL
OPTIONAL HEADER VALUES
10B magic # (PE32)
9.00 linker version
1800 size of code
1200 size of initialized data
0 size of uninitialized data
1AE4 entry point (10001AE4)
1000 base of code
3000 base of data
10000000 image base (10000000 to 10005FFF)
1000 section alignment
200 file alignment
6.01 operating system version
6.01 image version
5.01 subsystem version
0 Win32 version
6000 size of image
400 size of headers
7714 checksum
3 subsystem (Windows CUI)
140 DLL characteristics
Dynamic base
NX compatible
40000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
2710 [ 9D] RVA [size] of Export Directory
232C [ 64] RVA [size] of Import Directory
4000 [ 3D0] RVA [size] of Resource Directory
0 [ 0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
5000 [ 1C8] RVA [size] of Base Relocation Directory
10B0 [ 1C] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
0 [ 0] RVA [size] of Thread Storage Directory
1138 [ 40] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
1000 [ 9C] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
0 [ 0] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory
SECTION HEADER #1
.text name
17AD virtual size
1000 virtual address (10001000 to 100027AC)
1800 size of raw data
400 file pointer to raw data (00000400 to 00001BFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read
Debug Directories
Time Type Size RVA Pointer
-------- ------- -------- -------- --------
53978AFD cv 73 00001180 580 Format: RSDS, {6AFEFF09-4F33-4F1A-AE27-CA8FB3D57A60}, 1, d:\current\mscashdrawer\mscashdrawercontroller\mspos_dll\objfre_wxp_x86\i386\MSPOS_USB.pdb
SECTION HEADER #2
.data name
70C virtual size
3000 virtual address (10003000 to 1000370B)
400 size of raw data
1C00 file pointer to raw data (00001C00 to 00001FFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write
SECTION HEADER #3
.rsrc name
3D0 virtual size
4000 virtual address (10004000 to 100043CF)
400 size of raw data
2000 file pointer to raw data (00002000 to 000023FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only
SECTION HEADER #4
.reloc name
47C virtual size
5000 virtual address (10005000 to 1000547B)
600 size of raw data
2400 file pointer to raw data (00002400 to 000029FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42000040 flags
Initialized Data
Discardable
Read Only
Summary
1000 .data
1000 .reloc
1000 .rsrc
2000 .text
答案 0 :(得分:0)
事实证明,我试图在64位系统上使用32位dll。我希望这对其他人有帮助!