Jump to content

DTNGUYEN

Members
  • Posts

    10
  • Joined

  • Last visited

DTNGUYEN's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. I think this way is simple. However, the parameter have to be quoted to adapt with your function. Instead of we would like the parameter is the variable name like VarWrite($Something) we have to quote it VarWrite('$Something') Anyway, this is good but it will be better if we can build a function allow to use variable as parameter nartually: VarWrite($Something)
  2. For example: Func PrintOut($varName) ConsoleWrite("$varName = " & $varName) EndFunc $strName = "Harry" $intAge = 35 In this case if we call: PrintOut($strName) --> It will print out $varName = Harry PrintOut($intAge) --> It will print out $varName = 35 You see, it always prints out "$varName" but not the name of the varialbe. Actually, I really want to print out: PrintOut($strName) --> $strName = Harry PrintOut($intAge) --> $intAge = 35
  3. Do you know if AutoIt support any function to print out or to get a variable name. Example: GetVarName($strABCD) will return a string "$strABCD"
  4. Thank you very much for your help.
  5. Thanks for help. I try your code add using the code below It returns
  6. 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 !
  7. Thanks for help. However, i just find out another way to get by using _PathFull #incllude<file.au3> @LIB_DIR = _PathFull(@ScriptDir & "..\..\") & "LIB\"
  8. I would like to get parent folder path base on @ScriptDir. Please kind to help how to do it. Eg, @ScriptDir returns "C:\AutoIt\Script I would like to get "C:\AutoIt" in this case.
  9. Thank you very much. I can get it with ControlGetText() function.
  10. I would like to get value of result edit box in windows Calculator application. Can you please tell me how to do it. Thank you very much !
×
×
  • Create New...