我是新来的,我会尽力解释。我正在编写一些信息工具,该工具需要返回与特定硬件 ATM 相关的一些数据,所以我有它的 API,它的文档与 VB6 C++ 中的代码完全混淆,所以我需要调用 C++ 中原始代码的特定 dll 函数是这样的:
typedef struct _wfsversion
{
WORD wVersion;
WORD wLowVersion;
WORD wHighVersion;
CHAR szDescription[WFSDDESCRIPTION_LEN+1];
CHAR szSystemStatus[WFSDSYSSTATUS_LEN+1];
} WFSVERSION, * LPWFSVERSION;
//and Function calls APi and expect some response.
BOOL Wfs_StartUp(void)
{
WFSVERSION WfsVersion;
return (WFSStartUp(RECOGNISED_VERSIONS, &WfsVersion) == WFS_SUCCESS);
#define RECOGNISED_VERSIONS 0X00030203
在 AutoIt 中,我做了以下事情:
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <Array.au3>
Global Const $hXFSDLL = DllOpen ( "C:\Coding\infotool\msxfs.dll")
Global Const $RECOGNISED_VERSIONS = "0X00030203"
Global Const $lpWFSVersion = "word wVersion;word wLowVersion;word wHighVersion;char szDescription[WFSDDESCRIPTION_LEN+1];char szSystemStatus[WFSSYSSTATUS_LEN+1]"
$structLPWFSVERSION = DllStructCreate($lpWFSVersion)
DllCall($hXFSDLL,"BOOL","WFSStartUp","dword",$RECOGNISED_VERSIONS, "struct", DllStructGetPtr($structLPWFSVERSION))
ConsoleWrite("wVersion = "&DllstructGetData($structLPWFSVERSION,"wVersion"))
ConsoleWrite(@CRLF)
ConsoleWrite("wLowVersion = "&DllstructGetData($structLPWFSVERSION,"wLowVersion"))
ConsoleWrite(@CRLF)
ConsoleWrite("wHighVersion = "&DllstructGetData($structLPWFSVERSION,"wHighVersion"))
ConsoleWrite(@CRLF)
ConsoleWrite("szDescription = "&DllstructGetData($structLPWFSVERSION,"szDescription"))
ConsoleWrite(@CRLF)
ConsoleWrite("szSystemStatus = "&DllstructGetData($structLPWFSVERSION,"szSystemStatus"))
ConsoleWrite(@CRLF)
作为回应,我没有得到任何数据:
wVersion = 0
wLowVersion = 0
wHighVersion = 0
szDescription = 0
szSystemStatus = 0
所以我想知道我做错了什么?