Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/04/2011 in all areas

  1. Yashied

    WinAPIEx UDF

    LAST VERSION - 3.8 03-Jul-12 This library contains the WinAPI functions are not included for unknown reasons to the native AutoIt WinAPI library. I use this UDF in nearly all of my programs, and decided to share it with the AutoIt community. I agree that over time some of these functions will be part of the native AutoIt library, but still... The library includes some undocumented, but useful functions (eg _WinAPI_GetFontResourceInfo()). The library also contains all the necessary constants to work with the appropriate functions. Most functions from this UDF intended for experienced users, but beginners will find the same lot of useful information for yourself. I will be to periodically add new functions to the library. The archive contains WinAPIEx library, and as usual an excellent examples from me. Some examples I took from this forum and to simplify them for better understanding. For those who use SciTE (full version) I have prepared the au3.userudfs.properties and au3.user.calltips.api files to highlight functions from this UDF in your scripts. Just copy this files to ...SciTEProperties and ...SciTEAPI, respectively. I hope this UDF will be useful for many as for me. I look forward to any feedback and suggestions. Maybe somebody wants to add new WinAPI functions? Credits Available functions Files to download WinAPIEx UDF v3.8 for AutoIt 3.3.6.1 Previous downloads: 27953 WinAPIEx UDF v3.8 for AutoIt 3.3.8.x Previous downloads: 14850
    1 point
  2. Yashied

    WinAPIEx UDF

    The library has been updated. v3.5
    1 point
  3. The short answer to your question is "Yes". Now it begs some explanations to be really useful to you. Case #1: several processes are using one or several database(s) hosted on the same computer at the same time... easy. Case #2: several processes need to share one or more database over a network... not easy Case #1: be sure to read and understand the locking mecanism inside SQLite (see the SQLite docs). Now for each connection, use _SQLite_Timeout to specify a large enough timeout (more about this later). Then wrap _every_ Read-Modify-Write (RMW) transaction inside _SQLite_Exec($hDb, "begin immediate;") and _SQLite_Exec($hDb, "commit;") Immediate keyword is crucial in that it informs SQLite to place a reserved lock on the DB file, which will block subsequent attempt to obtain a write lock, until _you_ commit. In the meantime, read (select) operations by concurrent processes can run without being blocked. Also read locks can't be promoted to write locks in the meantime, as it would result in a deadlock situation, which your mission is to avoid like the plague. The timeout value needs to be long enough to allow for _any_ sequence ot RMW or W transactions to complete. SQLite does no serialization of the requests, so your applications must be ready to accept being delayed for possibly longer than the duration of only one RMW transaction by another process. In this framework, you never have to worry about receiving "Database is busy" error. In a low concurrency context like mine, I may have up to 7 processes using the DB, but I setup 15 minutes of timeout! (One of the process is a weekly Vacuum, another is a hourly live backup, which are both slow operations). If your context needs to be more responsive, then decrease the timeout down to a value you can cope with, but always test and deal for SQLITE_BUSY condition inside after any SQLite operation inside a transaction or not (even for reads!). Case #2 is much harder. SQLite uses the underlying filesystem to insure proper locking, but it turns out than almost every implementation of NFS, SMB, ... has enough bugs to sometimes cause DB corruption. Exposing how and why things are this way is a bit too much for this answer. Let's say that, without using a intermediate client/server layer, SQLite over a network isn't safe. Don't give up if you need it anyway, there are a number of open-source implementations available that allow such operation with excellent success. Hope this clears some mud. There are much information about all this in the SQLite web documentation.
    1 point
  4. picaxe

    _WordDocAddLink Help

    #include <Word.au3> $oWordApp = _WordCreate() ;_WordCreate(@ScriptDir & "\test.doc") $oDoc = _WordDocGetCollection ($oWordApp, 0) $oSelect = $oDoc.Application.Selection $oFind = $oSelect.Find For $i = 1 To 10 $oSelect.TypeText("Adding some text, line " & String($i)) If $i = 8 Then $oSelect.TypeText(@TAB & @TAB & "AutoIt" & @CRLF) Else $oSelect.TypeText(@CRLF) EndIf Next ; replace first occurance of text "AutoIt" with link With $oFind .Text = "AutoIt" .Forward = True .Wrap = 1 .Execute EndWith _WordDocAddLink ($oDoc, $oSelect.Range, "http://www.autoitscript.com", "", "AutoIt" & @CRLF, "Link to AutoIt") $oLinks = _WordDocLinkGetCollection ($oDoc) ConsoleWrite("Link Count " & @extended & @LF)
    1 point
×
×
  • Create New...