I have a structure in C++ like this. Please help me to create a structure for this.
struct structAutomobile
(
int flags;/ / -1: all elements of the structure are used / 0xE0 (0b11100000), then only the elements corresponding to the bits of value 1 will be used: nVerbose, strVerboseFile and nStandalone.
int nVerbose;/ / 0: verbose off, 1: verbose is
char * strVerboseFile;/ / Output file (path included) traces (verbose)
int nStandalone;/ / 0: throw srvcomm, 1: do not throw srvcomm
bool bActiveTrace;/ / False: trace inactive true: active track
bool bNoAction;/ / False: The DLL functions are running, true: the DLL functions and does not run API should return Fonction_OK
char * strUserProjectPath;/ / Directory Project
padding1 tank;
padding2 tank;
)
I try this but autoit return ">Exit code: -1073741819"
$str = "int flags; int nVerbose; char strVerboseFile[256]; int nStandalone; byte bActiveTrace; byte bNoAction; char strUserProjectPath[256]";
$a = DllStructCreate($str)
DllStructSetData($a, 1, -1)
DllStructSetData($a, 2, 0)
DllStructSetData($a, 3, "c:\Documents and Settings\dungnt\My Documents\DiamuxV5Data")
DllStructSetData($a, 4, 1)
DllStructSetData($a, 5, 0)
DllStructSetData($a, 6, 1)
DllStructSetData($a, 7, "c:\Documents and Settings\dungnt\My Documents\DiamuxV5Data")
ConsoleWrite("flags: " & DllStructGetData($a,"flags") & @crlf)
ConsoleWrite("nVerbose: " & DllStructGetData($a,"nVerbose") & @crlf)
ConsoleWrite("strVerboseFile: " & DllStructGetData($a,"strVerboseFile") & @crlf)
ConsoleWrite("nStandalone: " & DllStructGetData($a,"nStandalone") & @crlf)
ConsoleWrite("bActiveTrace: " & DllStructGetData($a,"bActiveTrace") & @crlf)
ConsoleWrite("bNoAction: " & DllStructGetData($a,"bNoAction") & @crlf)
ConsoleWrite("strUserProjectPath: " & DllStructGetData($a,"strUserProjectPath") & @crlf)
$rp = DllStructGetPtr($a)
ConsoleWrite($rp & @crlf)
$rc = DllCall($libDiamuxDll, "str", "ConfigureDiamux", "ptr", $rp)
ConsoleWrite($rc & @crlf)
Thank you very much !