저는 여기 새로 왔으며 최선을 다해 설명하려고 노력할 것입니다. 특정 하드웨어 ATM에 관련된 일부 데이터를 반환해야하는 정보 도구를 작성 중입니다. 따라서 해당 API가 있고 설명서가 VB6 코드로 완전히 혼동되고 있습니다. 그래서 특정 dll 함수를 호출해야합니다. 원래 코드는 C++입니다. 같은 : AutoIt을에서 AutoIt에서 DLL 함수를 호출하면 DLLStruct에 데이터가 없습니다.
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
나는 다음을했다 :
#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)
및 응답으로 나는 데이터 얻을 :
012,316을그래서 내가 뭘 잘못하고 있는거야?
WFSDDESCRIPTION_LEN 및 WFSSYSSTATUS_LEN의 값이에서 오는 않습니다 어디? 이 2 개의 상수를 적절한 정수 값으로 바꾸고 1을 더한 다음 임시 정수를 lpWFSVersion 문자열에 넣으십시오. – mrt
정확히 그 오류, xfsapi.h에 명시된 바와 같이 256 + 1로 변경 :( –