Rickname Posted April 6, 2013 Share Posted April 6, 2013 (edited) Do you guys know why or when to use "DllOpen" ( opening the needed dll ) before calling a function via DllCall ?Why I think that its still a good idea :- because errors or problems can appear when multiple calls of the same function ( eg. in a loop ) are made- because next time when calling the same function or other functions from the same dll can be more faster ?Am I right ? Edited April 6, 2013 by Rickname Link to comment Share on other sites More sharing options...
jchd Posted April 6, 2013 Share Posted April 6, 2013 DllOpen may have to perform a full load of things behind the hood and it's a slow operation. While it won't make any difference for basic system DLLs already loaded (~ no work to do) or if you DllCall a named DLL only once in a while, it makes a dramatic difference when DllCalling repeatedly a DLL by name which isn't already in use by the process. 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...
FireFox Posted April 7, 2013 Share Posted April 7, 2013 Your topic reminds me Link to comment Share on other sites More sharing options...
Rickname Posted April 7, 2013 Author Share Posted April 7, 2013 (edited) DllOpen may have to perform a full load of things behind the hood and it's a slow operation. While it won't make any difference for basic system DLLs already loaded (~ no work to do) or if you DllCall a named DLL only once in a while, it makes a dramatic difference when DllCalling repeatedly a DLL by name which isn't already in use by the process. Your topic reminds me So if I have While $timerdiff < 5000 DllCall("user32.dll".....) Wend its still a better (faster) idea to put DllOpen a dll before that "While" loop ? Or the PC will have more things to process and will be slower ? I'm little confused Edited April 7, 2013 by Rickname Link to comment Share on other sites More sharing options...
jchd Posted April 7, 2013 Share Posted April 7, 2013 user32.dll is one of the system DLLs which are always loaded for AFAIK every process, at least those doing significant work. Here the only difference will be to parse the DLL path, look it up in the list of loaded DLLs and retrieving the handle it has (gory details skipped). That means almost nothing. Rickname 1 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...
JohnOne Posted April 7, 2013 Share Posted April 7, 2013 So if I have While $timerdiff < 5000 DllCall("user32.dll".....) Wend its still a better (faster) idea to put DllOpen a dll before that "While" loop ? Or the PC will have more things to process and will be slower ? I'm little confused Yes it is. 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...
Rickname Posted April 7, 2013 Author Share Posted April 7, 2013 (edited) Yes it is.But just like @jchd said , the user32 library is used by absolutely so many processes, then its almost useless to open it with autoit too, no ? Edited April 7, 2013 by Rickname Link to comment Share on other sites More sharing options...
UEZ Posted April 7, 2013 Share Posted April 7, 2013 (edited) I assume that a DllOpen() will load the full or a part from the DLL into the memory which is faster to call instead of loading the DLL each time on a DLLCall. But I don't know how the os handle DLLs which are permantly used by apps. It might be that those DLLs are also cached in the memory. Br, UEZ Edited April 7, 2013 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
JohnOne Posted April 7, 2013 Share Posted April 7, 2013 But just like @jchd said , the user32 library is used by absolutely so many processes, then its almost useless to open it with autoit too, no ?Yes, but as jchd also said, if you don't open it first, autoit will have to look through a list of already loaded dll files to see if it is open and retrieve a handle to it each time you call it. Rickname 1 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 April 7, 2013 Share Posted April 7, 2013 Ummm, I believe it's rather the OS job to do that. It's also responsible for invoking the DLL init function and such. 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...
JohnOne Posted April 7, 2013 Share Posted April 7, 2013 Whoever job it is, I'm sure it's quicker, no matter how much for multiplr calls when I handle is used. 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...
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