BitRot Posted October 1, 2006 Share Posted October 1, 2006 Hello All, I would like to be able to use a DLL-function that needs to do a "Call-back". The problem is that I have absolutily no idea if that is possible, and if it is how to convert an AI-function address into one that a DLL-function understands. I remember VB had something like an "AddressOf" operator, which would probably suit my needs. A related problem : A call-back function is mostly executed with a number of "simple" arguments on the stack. Those arguments need ofcourse allso be converted into something AI can handle. Any ideas ? By the way : the function I'm talking about is "EnumChildWindows" Link to comment Share on other sites More sharing options...
lod3n Posted October 1, 2006 Share Posted October 1, 2006 Take a look at AutoItX [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
BitRot Posted October 1, 2006 Author Share Posted October 1, 2006 Take a look at AutoItXJust did, and its a bit ... overwhelming. Could you be a bit more specific, like which one of those calls (under "DLL Interface" -> "Function Prototypes C" I should look at, and how I get to the real information (such as how to define & use it) ? (Or if thats the wrong location, where else to look)Thanks. Link to comment Share on other sites More sharing options...
piccaso Posted October 1, 2006 Share Posted October 1, 2006 you cant call a autoit function from the outside but you can use windows messaging. check the helpfile for GUIRegisterMsg CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
BitRot Posted October 1, 2006 Author Share Posted October 1, 2006 you cant call a autoit function from the outside That's not really what I hoped to hear but you can use windows messaging.check the helpfile for GUIRegisterMsgI just took a look at both "GUIRegisterMsg" and "EnumChildWindows", but do not see a method, using AI's own commands, to convert to the output of the latter so that it can be transferred by the first. Any hints ? Link to comment Share on other sites More sharing options...
piccaso Posted October 1, 2006 Share Posted October 1, 2006 here is an example using WM_COPYDATA if you tell me what the message looks like i can tell you how to decode it...the easiest way would be a ptr to a struct so you can use DllStruct* functions to access it.if its just a null terminated string you want to read from memory, i can give you thissligtly modified function i made for the sqlite3.dll wrapper i wrote (see sig)...Func _szStringRead($iszPtr, $iLen = -1) Local $aStrLen, $vszString If $iszPtr < 1 Then Return "" If $iLen < 0 Then $aStrLen = DllCall("msvcrt.dll", "int", "strlen", "ptr", $iszPtr) If @error Then Return SetError(1, 0, "") $iLen = $aStrLen[0] + 1 EndIf $vszString = DllStructCreate("char[" & $iLen & "]", $iszPtr) If @error Then Return SetError(2, 0, "") Return SetError(0, $iLen, DllStructGetData($vszString, 1)) EndFunc ;==>_szStringRead CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
lod3n Posted October 2, 2006 Share Posted October 2, 2006 There has already been some work done with EnumChildWindows, including callbacks:http://www.autoitscript.com/forum/index.php?showtopic=32077There's more if you search the forum... [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
BitRot Posted October 2, 2006 Author Share Posted October 2, 2006 here is an example using WM_COPYDATAThanks, but I don't think that is what I'm looking for. What I'm looking for is a method that makes it possible for an AI-function to be called by a DLL-function.None-the-less, thanks for trying (I did put those two scripts in my "could be interresting" -repository ) Link to comment Share on other sites More sharing options...
BitRot Posted October 2, 2006 Author Share Posted October 2, 2006 There has already been some work done with EnumChildWindows, including callbacks:http://www.autoitscript.com/forum/index.php?showtopic=32077There's more if you search the forum...Thanks for the link. I allready was afraid that it would need a user-written DLL to be able to do it. And you're right, I should have searched the fora first. For some reason I did not even think of it. Link to comment Share on other sites More sharing options...
livewire Posted October 2, 2006 Share Posted October 2, 2006 Here is the response I got when I asked the question. Link to comment Share on other sites More sharing options...
BitRot Posted October 2, 2006 Author Share Posted October 2, 2006 (edited) Here is the response I got when I asked the question.Short, and crystal-clear. Edited October 2, 2006 by BitRot Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now