Da ich einen Videostream in AutoIt möglich machen will in dem man nicht einzelne Frames verschickt, sondern echtes Video, habe ich sehr lange nach einer Methode gesucht einen Videostream zu erstellen. Als ich aber die Methode gefunden habe einen Videostream zu erstellen und ihn beim Schließen zu speichern, dachte ich mir: Wieso nicht einfach zwischenspeichern und die hinzugekommenen/geänderten Bytes zum Empfänger senden?
Tja. Ich bin nicht so der DllCall Experte da ich nicht so der C++ Profi bin, und in C# auch erst recht neu bin, habe ich etwas gebraucht bis ich den DllCall erstmal mit den richtigen Parametern & Datentypen vollständig hatte.
Aber da die AVI Datei nicht zwischendurch gespeichert wurde habe ich eine MsgBox ans Ende der Funktion gepackt, damit ich sehen kann was zurückgegeben wird.
Resultat: @error = 1, der Rest 0
Die AutoIt Hilfe sagt natürlich: @error 1 = unable to use the DLL file
Aber das Problem ist: Die DllCalls rufen ALLE die selbe DLL auf. D.h sowohl die Funktion die ich einfügen will, als auch die um den Stream zu erstellen und zu schließen.
Also was denkt ihr ist da falsch?
Downloadlink zu den Dateien (Problematische Funktion: AVISave):
Hi, there have u tried turning it off and on?.
So the other functions of the dll are working fine?, then are u sure u have to use stdcall method instead of cdecl.
I'm sorry don't speak german :c. I'm also afraid that i looked at your code and looks complicated, keep it up you will solve it soon!
Hi, there have u tried turning it off and on?.
So the other functions of the dll are working fine?, then are u sure u have to use stdcall method instead of cdecl.
I'm sorry don't speak german :c. I'm also afraid that i looked at your code and looks complicated, keep it up you will solve it soon!
Mmm, maybe its a problem with the dll, if its a x64 dll then u can't run it with scite, you should first compile the script x64 then run it, that worked for me with a test i made...
Mmm, maybe its a problem with the dll, if its a x64 dll then u can't run it with scite, you should first compile the script x64 then run it, that worked for me with a test i made...
Alright, u should:
1º-> Have u checked with pe explorer or something if your dll is exporting AVISave, maybe u missed it in your def file.
2º-> Check that every parameter that u are using is the equivalent to autoit.
3º-> Use a debugger to find out what it is happening with those parameters, (ollydbg should work) setting a breakpoint in AVISave call.
4º-> if still don't get it. Is autoit the best language for your project?. Translating those functions to C++ won't be so hard.
(if olly isn't working try using some plugins since autoit will check for debuggers)
Alright, u should:
1º-> Have u checked with pe explorer or something if your dll is exporting AVISave, maybe u missed it in your def file.
2º-> Check that every parameter that u are using is the equivalent to autoit.
3º-> Use a debugger to find out what it is happening with those parameters, (ollydbg should work) setting a breakpoint in AVISave call.
4º-> if still don't get it. Is autoit the best language for your project?. Translating those functions to C++ won't be so hard.
(if olly isn't working try using some plugins since autoit will check for debuggers)
Good Luck and Have fun doing your research!
The thing is that I want to show the world that you can do videostreaming using autoit.
To your other arguments: @error 1 means that the file can't be used. That means: the parameters don't have anything to do with it. Only the ":cdecl" could also cause this error, but it isn't because I tried it too.
hatte das problem auch mal in autoit das eine dll mit den autoit funktionen nicht ansprechbar war.
Meine lösung:
PHP Code:
;Example of using DllCallAddress Func _CallFunction($pointer, $returntype) Local $hResult = DllCallAddress($returntype, $pointer, "int",0,"int",0,"int",@DesktopWidth,"int",@DesktopHeight,"str",@DesktopDir & "\imgsrc.bmp") If Not IsArray($hResult) Then Return False Return $hResult[0] EndFunc
;Gets the address of the fucntion. param1 = module handle param2 = "Function" Func _GetFunctionPointer($hDll, $name) Local $hOpen = DllOpen("kernel32.dll") $hResult = DllCall($hOpen, "DWORD", "GetProcAddress", "HANDLE", $hDll, "STR", $name) DllClose($hOpen) If $hResult[0] = null Then Return False Return $hResult[0] EndFunc
;Returns the module handle Func _LoadLibrary($path) Local $hOpen = DllOpen("Kernel32.dll") $hResult = DllCall($hOpen, "HANDLE","LoadLibrary", "STR", $path) DllClose($hOpen) If $hResult[0] = Null Then Return False Return $hResult[0] EndFunc
;closes the module Func _FreeLibrary($hModule) Local $hOpen = DllOpen("Kernel32.dll") $hResult = DllCall($hOpen, "BOOL","FreeLibrary", "HANDLE", $hModule) DllClose($hResult) If $hResult[0] = 0 Then Return False Return True EndFunc
#Edit:
Für DllCallAddress gibts auch api funktionen falls autoit nicht will
#Edit2:
Bei dem beispiel funktionsaufruf handelte es sich um eine von mir geschriebene IMG search dll die leider doch keinen geschwindigkeitsvorteil brachte dank autoshit^^
Edit3:
Wohl zu früh am morgen...
Die mühe mit den return hab ich mir gemacht um autoshit beizubringen True als sting auszugeben und keine 1. Ich hasse den autoit variant
DllCall Expert, please an help 07/29/2014 - AutoIt - 11 Replies Guten Morgen :D
I need you guys and only this forum can help me. I want to convert another language to autoit, is a couple of lines:
hxxps://github.com/Drugoy/Autohotkey-scripts-.ahk /blob/master/hyde/test%20hyde.ahk
This is my attempt, i think only the first DllCall is correct:
OnAutoItExitRegister("_Exit")
Global $hMod, $hHook
Dllcall auf eigener dll? 05/12/2012 - AutoIt - 5 Replies Servus,
hab mir eben ne kleine .dll in C++ geschrieben.
Die führt eine einfache Main funktion aus, die den typen int besitzt.
Also, sobald die dll in einen Process attached wird, wird die Main Funktion ausgeführt und eine MessageBox wird geöffnet. Diese befindet sich ebenfalls in der Main Funktion.
Nun meine Frage.
Kann ich diese Funktion mithilfe von Autoit aufrufen wie z.B mit dem dllcall ?
[DllCall] FRAPS mit Autoit ansteuern 06/03/2011 - AutoIt - 0 Replies Hallo erstmal :)
Folgendes FRAPS ist ja ein Benchmark-, Screencapture- und
Echtzeitvideoaufnahmeprogramm für DirectX- und OpenGL-Anwendungen.
--> mich interessieren allerdings nur die Frame Benchmark Funktionen.
http://www.fraps.com/images/33fps.png
[Frage] DllCall, EndScence, Hook, LUA Injection 04/24/2011 - General Coding - 10 Replies Hallihallo,
ich bin mir nicht ganz sicher, ob da hier richtig ist, da es sich auf WoW bezieht.
Ich möchte via AutoIt ein kleines Tool schreiben, mit dem ich z.B. den 'Charakter erstellen' Button drücken kann, ohne das WoW Fenster maximiert zu haben (ControlClick, Mouseclick plus funktionieren bei WoW nicht).
Dazu hab ich mich natürlich schon schlau gemacht und bin auf einige Begriffe wie Endscene, Hook, LUA Injection und die Funktion WowLuaDoString gestoßen.
Jetzt meine Frage: Besteht...
DLL injection und AutoIT DLLCall 11/30/2010 - AutoIt - 4 Replies Hallo,
ich hab ein Problem was mit seit ein paar Stunden den Kopf zerbricht, vllt ist es auch einfach der falsche Ansatz.
Ich hab mir eine DLL zum injizieren mit C++ geschrieben, durch Winject wird diese auch injiziert und die main Funktion durch die WINAPI DLLMain aufgerufen (einfach nur eine MsgBox).
Jetzt besteht meine Frage / Problem darin, kann ich mit AutoIt die restlichen Funktionen auch aufrufen (durch DLLCall) oder soll man dass auch lieber mit C++ realisieren. (andere...