Shafayat 3 Posted May 14, 2010 I've been searching over and over again but all in vain. I could not find an example (a complete and working one) for creating a dll in Visual c++ 2008 whose function can be directly called from AutoIt. Please, anyone, can you post a complete example dll? I'm just starting to create dlls in c++ and the 2008 is the Ide I'm using. [Not using this account any more. Using "iShafayet" instead] Share this post Link to post Share on other sites
wraithdu 83 Posted May 14, 2010 (edited) I find that impossible to believe... ANY dll created in any IDE with an exported function call be called from AutoIt (well there might be something weird with .NET dlls, so don't quote me literally ) You tried and got an error or something? You sure you created your DLL as stdcall versus cdecl? Edited May 15, 2010 by wraithdu Share this post Link to post Share on other sites
zamzam27 0 Posted May 15, 2010 sorry stupid question and really simple answer but whats wrong with this code? Func start HotKeySet("c", click) $x=-1 Func click() $x=$x*-1 endfunc while $x=1 MouseClick("left",740, 400, 1,1000) Wend EndFunc trying to make it click rapidly when i press c and stop clicking when i press c again Share this post Link to post Share on other sites
Richard Robertson 187 Posted May 15, 2010 (edited) I always export my functions as cdecl functions. It's easier because it avoids the name decoration problems.extern "C" { __declspec(dllexport) int Add(int a, int <img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' /> { return a + b; } }$returned = DllCall("mydll.dll", "int:cdecl", "Add", "int", 12, "int", 43) MsgBox(0, "", $returned[0]) ; should be 55 Edited May 15, 2010 by Richard Robertson Share this post Link to post Share on other sites
wraithdu 83 Posted May 15, 2010 @zamzam WTF makes you think your question has anything to do with this topic or is in any way appropriate for this forum? Share this post Link to post Share on other sites
Shafayat 3 Posted May 15, 2010 Thanks Richard. That's exactly what I was doing wrong. My dll was alright. I just didn't use the array. I'm getting stupider, I guess. thanks people. Problem solved! [Not using this account any more. Using "iShafayet" instead] Share this post Link to post Share on other sites
Richard Robertson 187 Posted May 15, 2010 @zamzamWTF makes you think your question has anything to do with this topic or is in any way appropriate for this forum?He posted it in a bunch of threads. Not only is it an incomplete question, it's annoying in location.Thanks Richard.That's exactly what I was doing wrong. My dll was alright. I just didn't use the array. I'm getting stupider, I guess. thanks people. Problem solved! Yeah, a lot of people forget that DllCall returns an array. I do it sometimes too. Share this post Link to post Share on other sites
wholesaleeshops 0 Posted November 13, 2010 I just didn't use the array. I'm getting stupider, I guess. Share this post Link to post Share on other sites
canny 0 Posted December 18, 2010 AutoIt Download,Automation Software, AutoIt is a simple tool that can simulate key presses. Directly call external DLL and Windows API functions. AutoIt will also allow you to create some complex Graphical User Interfaces (GUIs). Share this post Link to post Share on other sites