DLL parameter

  • hm. Jetzt wäre ein Blick in eine ordentliche Dokumentation der DLL hilfreich.

    "Je mehr Käse, desto mehr Löcher; je mehr Löcher, desto weniger Käse. Ergo: Je mehr Käse, desto weniger Käse. 8| "
    "Programmers never die: they just GOSUB without RETURN"
    "I tried to change the world but I couldn't find the source code."

  • Schau mal in "\SDK\unmanage\" bzw. " \include\" nach. Dort sollten .h-Dateien sein und in denen sollte dann z.B. "#define LFX_ERROR_NOINIT x" stehen. In deinem Code musst du dann x verwenden statt LFX_ERROR_NOINIT. Die Funktionsnamen bleiben natürlich gleich.

  • [autoit]

    $Strut = DllStructCreate('char 0x00FF0000;char 0xFF000000')
    $Call = DllCall($hDll, 'uint', 'LFX_Light', 'char', 0x000200, 'char', $Strut)

    [/autoit]


    LFX_Light ist so wie ich das sehe, anders definiert:

    Code
    LFX_RESULT LFX_Light(
    const unsigned int locationMask,
    const unsigned int colorVal);

    Du hast z.B. char benutzt, der Prototype sagt unsigned int.

    In der PDF ist auf Seite 7 ist ein Beispiel in C/C++.

    Spoiler anzeigen


    ich habe das mal in AutoIt umgeschrieben:

    Spoiler anzeigen
    [autoit]

    Global Const $LFX_ALL = 0, $LFX_BLUE = 0, $LFX_FULL_BRIGHTNESS = 0
    Local $sPath = "LightFX.dll", $hDll = DllOpen($sPath)
    DllCall($hDll, 'uint', 'LFX_Initialize')
    DllCall($hDll, 'uint', 'LFX_Reset')
    DllCall($hDll, 'uint', 'LFX_Light', 'uint', $LFX_ALL, 'uint', BitOR($LFX_BLUE, $LFX_FULL_BRIGHTNESS))
    DllCall($hDll, 'uint', 'LFX_Update')
    DllCall($hDll, 'uint', 'LFX_Release')
    DllClose($hDll)

    [/autoit]


    Leider bin ich nicht im Besitz eines Alienware AlieFX und habe auch nicht das SDK, weshalb du die Werte für $LFX_ALL, $LFX_BLUE und $LFX_FULL_BRIGHTNESS selbst einsetzen musst. Ich konnte meinen Code daher auch nicht testen.
    Ich hoffe das hilft dir trotzdem weiter.

    mfg
    Developer30

    "Je mehr Käse, desto mehr Löcher; je mehr Löcher, desto weniger Käse. Ergo: Je mehr Käse, desto weniger Käse. 8| "
    "Programmers never die: they just GOSUB without RETURN"
    "I tried to change the world but I couldn't find the source code."

    Einmal editiert, zuletzt von Developer30 (1. November 2012 um 15:43)

  • Vielen Dank,

    Hab die Werte aus LFXDecl.h eingetragen,
    Aber Leider funzt es net.

    Die Au3-exe hängt sich jedes mal beim starten auf,
    wenn man allerdings die Zeile mit dem Befehl LFX_Light
    herauslässt passiert zwar nix, aber es hängt sich net auf.

    So sieht das Skript im Moment aus:

    Spoiler anzeigen
    [autoit]

    Global Const $LFX_ALL = 0x07FFFFFF, $LFX_BLUE = 0x000000FF, $LFX_FULL_BRIGHTNESS = 0xFF000000
    Local $sPath = ".\LightFX.dll", $hDll = DllOpen($sPath)
    DllCall($hDll, 'uint', 'LFX_Initialize')
    DllCall($hDll, 'uint', 'LFX_Reset')
    DllCall($hDll, 'uint', 'LFX_Light', 'uint', $LFX_ALL, 'uint', BitOR($LFX_BLUE, $LFX_FULL_BRIGHTNESS))
    DllCall($hDll, 'uint', 'LFX_Update')
    DllCall($hDll, 'uint', 'LFX_Release')
    DllClose($hDll)

    [/autoit]