Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/10/2013 in all areas

  1. Thanks you so much Shaggi !!! After some test & change for my application, it works fine
    1 point
  2. Autoit doesn't allow arrays of user defined types inside other structs. One way to it is by allocating a raw block of memory sized to your array, and alias your way into it, kind of like this: $tagMYSTRUCT = "int code; char msg[10];" $mystruct = ArrayStruct($tagMYSTRUCT, 4) $fourth_element = getElement($mystruct, 3, $tagMYSTRUCT) ; $fourth_element is an alias of '$mystruct[3]' DllStructSetData($fourth_element, "code", 3); DllCall(...., "struct*", $mystruct) Func ArrayStruct($tagStruct, $numElements) $sizeOfMyStruct = DllStructGetSize(DllStructCreate($tagMYSTRUCT)) // assumes end padding is included $numElements = 4 $bytesNeeded = $numElements * $sizeOfMyStruct return DllStructCreate("byte[" & $bytesNeeded & "]") EndFunc Func GetElement($Struct, $Element, $tagSTRUCT) return DllStructCreate($tagSTRUCT, DllStructGetPointer($Struct) + $Element * DllStructGetSize(DllStructCreate($tagStruct))) EndFunc Its the C equivalent of doing this: typedef struct { int code; char msg[10]; } MyStruct; void example() { MyStruct structs[10]; something(structs); //or MyStruct * ptrstructs = (MyStruct*) malloc(sizeof MyStruct * 10); something(ptrstructs); } void something(MyStruct input[]) {}
    1 point
  3. Bert

    StringRegExp Help...

    In the helpfile there is a script that is actually a StringRegEx tool. Look in the Tutorial section > String Regular Expression. At the bottom of the page is the button to open the script in SciTE. Run it and the tool will make it much easier to figure out what you have in mind. Also, read the tutorial. It helps!
    1 point
  4. MvGulik

    Help

    Original Title. *Tosses lifebuoy across topic* Mmm, "Titanic" ... oops.
    1 point
  5. Colyn1337

    RegRead

    I've had better luck with the shortname, there's a limit to how long the reg query string can be. Tho offhand I don't recall what it is. @usera is it a 64bit box? If so you'll want to use HKLM64 Also, add this code right after your regread() so maybe we can catch an error: If @error Then msgbox(0, "error", @error) if there's a number in the error text box, please post it.
    1 point
×
×
  • Create New...