RaiNote Posted July 18, 2015 Share Posted July 18, 2015 (edited) May Test that#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** $dll1 = DllOpen("DllBasics.dll") DllCall($dll1,"none","Function")if u do DllCall the Function will be run and the MsgBox should Pop upDllBasics.dllDLLCall.au3DLLCall.exe Does my work for you and your own too? or still something Bugs? Edited July 18, 2015 by RaiNote Files C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
TheShaps Posted July 18, 2015 Author Share Posted July 18, 2015 yea.. not working same problem, I don't understand why it works for you, but for me not. thanks for the help anyway Link to comment Share on other sites More sharing options...
RaiNote Posted July 18, 2015 Share Posted July 18, 2015 Which AutoIt Version? May install Autoit 32bit Version °-° C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
TheShaps Posted July 18, 2015 Author Share Posted July 18, 2015 Autoit version 3.3.12.0 Link to comment Share on other sites More sharing options...
RaiNote Posted July 18, 2015 Share Posted July 18, 2015 install latest Version 3.3.14.0 and test it again ^-^ just try everything ^-^ C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
JohnOne Posted July 18, 2015 Share Posted July 18, 2015 Have you tried simply calling the dll function?I'm pretty sure you need an entry point function for DllOpen, perhaps you do not for simple DllCall. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jchd Posted July 18, 2015 Share Posted July 18, 2015 Are streams (cin, cout from iostream) part of C now? DllCall is for calling C. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
TheShaps Posted July 18, 2015 Author Share Posted July 18, 2015 (edited) okay update:so I tried to run the DllCall.au3 that RaiNote has provided me with, and it totally worked I was in shock!then I tried to copy the code to my func but it didn't work. $dll1 = DllOpen("DllBasics.dll") DllCall($dll1,"none","Function") ;DllCall($dll1,"none","Function")but if I got the code out of the function it works, runining it by right clicking> Run Script works. The file is called after the func name. The problem is that if I call the function from the main program it still doesn't work. how do I make it work by calling it from the main function? I have included the file name in the main programeven if I change the DllCall.au3 file to this: and add a function it stops working #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Func func2() $dll1 = DllOpen("DllBasics.dll") DllCall($dll1,"none","Function") DllCall($dll1,"none","Function") EndFuncThanks for your help guys !! Edited July 18, 2015 by TheShaps Link to comment Share on other sites More sharing options...
JohnOne Posted July 18, 2015 Share Posted July 18, 2015 You have to call the function. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Danyfirex Posted July 18, 2015 Share Posted July 18, 2015 maybe you need to learn the basic of programming instead walking with closed eyes. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
TheShaps Posted July 18, 2015 Author Share Posted July 18, 2015 of course I am calling the function. it just doesn't work when its inside the function. I am calling it form the main function Link to comment Share on other sites More sharing options...
Danyfirex Posted July 18, 2015 Share Posted July 18, 2015 did you try your dll from Visual Studio? Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
TheShaps Posted July 18, 2015 Author Share Posted July 18, 2015 (edited) Danyfirexokay mister genius and knows everything. then explain why calling the user32.dll worked but calling my dll from the function doesn't "did you try your dll from Visual Studio?" Omg did you even read the post? what do you mean? calling it from visual studio? creating it in visual studio? yes the dll was created in visual studio. Edited July 18, 2015 by TheShaps Link to comment Share on other sites More sharing options...
Danyfirex Posted July 19, 2015 Share Posted July 19, 2015 if I was a genius don't be here helping another just for free. it That I said. its just a suggestion. someone genius like me(¬¬) makes stupids trying to help someone like you. Maybe I did not read well. ( I'm not an English native speaker.) so maybe for that I did wrong.But I'm sure other people here appreciate the effort that I do for helping them.good luck with your proyects. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
RaiNote Posted July 19, 2015 Share Posted July 19, 2015 Are streams (cin, cout from iostream) part of C now? DllCall is for calling C.Well you can use it like me with C++ if you use it extern. of course I am calling the function. it just doesn't work when its inside the function. I am calling it form the main function Code CPP:expandcollapse popup// Inclusion guard #ifndef _DLLTUT_DLL_H_ #define _DLLTUT_DLL_H_ // Make our life easier, if DLL_EXPORT is defined in a file then DECLDIR will do an export // If it is not defined DECLDIR will do an import #if defined DLL_EXPORT #define DECLDIR __declspec(dllexport) #else #define DECLDIR __declspec(dllimport) #endif // Specify "C" linkage to get rid of C++ name mangeling extern "C" { // Declare 2 functions DECLDIR int Add( int a, int b ); DECLDIR void Function( void ); } // End the inclusion guard #endif // DECLDIR will perform an export for us #define DLL_EXPORT // Include our header, must come after #define DLL_EXPORT #include "dll_tutorial.h" #include <iostream> #include <Windows.h> #include <winbase.h> // Get rid of name mangeling extern "C" { // Define our 2 functions // Add will return the sum of two numbers DECLDIR int Add(int a, int b) { return(a + b); } // Function will print out a text string DECLDIR void Function(void) { const WORD colors[] = { 0x1A, 0x2B, 0x3C, 0x4D, 0x5E, 0x6F, 0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6 }; HANDLE hstdin = GetStdHandle(STD_INPUT_HANDLE); HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE); WORD index = 0; SetConsoleTitle((LPCWSTR)L"Project 1"); SetConsoleTextAttribute(hstdout, 0x0C); CONSOLE_SCREEN_BUFFER_INFO csbi; GetConsoleScreenBufferInfo(hstdout, &csbi); std::cout << "DLL Called!\n" << std::endl; FlushConsoleInputBuffer(hstdin); int msgbox = MessageBox(NULL, (LPCWSTR)L"DLL for AutoIt", (LPCWSTR)L"Example °-°", MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON1); switch (msgbox) { case IDOK: SetConsoleTitle((LPCWSTR)L"OK Clicked"); SetConsoleTextAttribute(hstdout, 0x0D); std::cout << "MsgBox Button Ok\nhas been clicked succesfully!\n" << std::endl; break; case IDCANCEL: SetConsoleTitle((LPCWSTR)L"Cancel Clicked"); SetConsoleTextAttribute(hstdout, 0x01); std::cout << "MsgBox Button Cancel\nhas been clicked succesfully!\n" << std::endl; break; }; }; }; Code Header:// Inclusion guard #ifndef _DLLTUT_DLL_H_ #define _DLLTUT_DLL_H_ // Make our life easier, if DLL_EXPORT is defined in a file then DECLDIR will do an export // If it is not defined DECLDIR will do an import #if defined DLL_EXPORT #define DECLDIR __declspec(dllexport) #else #define DECLDIR __declspec(dllimport) #endif // Specify "C" linkage to get rid of C++ name mangeling extern "C" { // Declare 2 functions DECLDIR int Add( int a, int b ); DECLDIR void Function( void ); } // End the inclusion guard #endif Also try using my Project and Maybe u should use Visual Studio 2013 because of bug fixes and some other extras ^-^. and if u could ask Why are there so many "funcs" within my Code just because i was bored and tested something ^-^. If it also don't work with my Project using then something left on you Computer may some .Net Version. C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
RaiNote Posted July 19, 2015 Share Posted July 19, 2015 (edited) Have you tried simply calling the dll function?I'm pretty sure you need an entry point function for DllOpen, perhaps you do not for simple DllCall. okay update:so I tried to run the DllCall.au3 that RaiNote has provided me with, and it totally worked I was in shock!then I tried to copy the code to my func but it didn't work. $dll1 = DllOpen("DllBasics.dll") DllCall($dll1,"none","Function") ;DllCall($dll1,"none","Function")but if I got the code out of the function it works, runining it by right clicking> Run Script works. The file is called after the func name. The problem is that if I call the function from the main program it still doesn't work. how do I make it work by calling it from the main function? I have included the file name in the main programeven if I change the DllCall.au3 file to this: and add a function it stops working #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Func func2() $dll1 = DllOpen("DllBasics.dll") DllCall($dll1,"none","Function") DllCall($dll1,"none","Function") EndFuncThanks for your help guys !! If you do it with Func func2() you have then to run this Function like. And Why it not working for you is idk why may could you upload your Project? or try it with mine (You could Change everything to what you like but if you do something wrong within the Header everything Ends ^-^)func2();Function func2() being runned sleep(250);just a little time out :oDllExampleCall("DllBasics","Function","none") Func DllExampleCall($dllname,$dllFunc,$dllreturn);$dllname without dll $dllFunc what Func is being called $dllreturn Return Parameter(1,0,-1,none) i think.. $dll1 = DllOpen($dllname & ".dll") DllCall($dll1,$dllreturn,$dllFunc) EndFunc You have to call the function.He can only call the Function after he Opened the DLL with $dll = DllOpen("DLLname.dll") and using after this DllCall($dll, "none", "Function"); $dll= the dll "None" is the return Parameter so it just called and after this end "Function" is the Name of the Function. I hope any of These Infos was helpful :3p.s.: I don't know anything of using Dll's with AutoIt i just looked up the params for the Command Edited July 19, 2015 by RaiNote C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
RaiNote Posted July 19, 2015 Share Posted July 19, 2015 @TheShaps (reminding) Also would it possible to read with AutoIt What the console writes?:O Just like you are using within the dll std::cing.get();so that some Value is being read and maybe displayed in a MsgBox. C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
JohnOne Posted July 19, 2015 Share Posted July 19, 2015 @TheShapsAre you saying that this works..$dll1 = DllOpen("DllBasics.dll") DllCall($dll1,"none","Function")But this does not...func2() Func func2() $dll1 = DllOpen("DllBasics.dll") DllCall($dll1,"none","Function") EndFuncAlso might be wise to adjust your attitude a little @Danyfirex was trying to help you. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
RaiNote Posted July 19, 2015 Share Posted July 19, 2015 (edited) @JohnOne his Problem is that his Code won't work if he uses it but if he uses mine it work. °-°That's the main Problem.Edit: That it inside of func won't work (because he Forget func2() maybe) Edited July 19, 2015 by RaiNote C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 19, 2015 Moderators Share Posted July 19, 2015 RaiNote,There is an "Edit" button - please stop making multiple short posts in immediate succession.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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