Bridawg Posted January 28, 2014 Share Posted January 28, 2014 So I'm running the sample from the singleton help page and it's not working properly: #include <Misc.au3> #include <MsgBoxConstants.au3> If _Singleton("test", 1) = 0 Then MsgBox($MB_SYSTEMMODAL, "Warning", "An occurence of test is already running") Exit EndIf MsgBox($MB_SYSTEMMODAL, "OK", "the first occurence of test is running") I can run as many instances of this as I like but the "Warning" never triggers. The return value of _Singleton is 0x0000020C but testing for that doesn't get me any further. Any Advice? I'm running the portable version of title="AutoIt v3.3.10.2">AutoIt v3.3.10.2 on Windows 7 Enterprise SP1 32 Bit Thanks Link to comment Share on other sites More sharing options...
michaelslamet Posted January 28, 2014 Share Posted January 28, 2014 is there any change you dont save the script with name "test.au3" ? try to compiled it as test.exe and run it Link to comment Share on other sites More sharing options...
Bridawg Posted January 28, 2014 Author Share Posted January 28, 2014 I saved the script above as test.au3 and compiled it. The result is the same 3 boxes saying that the first instance is running. Really strange. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 28, 2014 Moderators Share Posted January 28, 2014 Bridawg,You do realise that you need to keep the first instance running? Run the exe for the first time and leave the "first occurence" MsgBox on screen. Now run the exe again and the "already running" MsgBox appears. 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...
Bridawg Posted January 28, 2014 Author Share Posted January 28, 2014 Yes, I get that All 3 windows are running at the same time - I don't press "OK" to close them. Link to comment Share on other sites More sharing options...
l3ill Posted January 28, 2014 Share Posted January 28, 2014 Bridawg, I just tested Portable Version, same setup as you... saveas test.au3 to desktop build... start test.exe x 3 and I get 1 x the first occurence of test is running and 2 x An occurence of test is already running also went ahead and tested on Win 8 64 bit and that works fine too... Bill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Bridawg Posted January 28, 2014 Author Share Posted January 28, 2014 Thanks Bill - that's good to know. Do you know if my Singleton return value (0x0000020C) is unusual? I'm on a corporate network. I looked at the UDF and it's a DLL call so I'm wondering if I'm somehow locked down. Thanks, Brian Link to comment Share on other sites More sharing options...
l3ill Posted January 28, 2014 Share Posted January 28, 2014 Hi Brian, Sorry, no.idea I just ran it a couple of times to see the return it was always similar number last 3 number and a letter. only thing I can still think of is the pc I ran the Portable on already has AutoIT installed so maybe you have a permission issue on your usb or script...or as you say the udf are not being granted access through the bus. good luck anyway. Bill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example 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