On 10/10/2006 4:43 PM, Dr Gerard Hammond wrote: > Why is this Win32 mutex thingy failing > > My App object has this in the Open event > > #if TargetWin32 then > appmutex = new Mutex( "Risky Business SOS" ) > if NOT appmutex.TryEnter then // Already running... > MsgBox "Please only use one instance of RiskyBusinessSOS at a time." > > Quit > end if > #endif
I assume that you have a corresponding call to Leave in the Close event. If not, you may leak the mutex (I don't know how RB handles objects owned by processes that terminate). > My App object has one property: > Protected appmutex As mutex > > Trying to open a second instance in Windows throws an exception : Sub > Mutex.Leave( Mutex ) What type of exception? What is the Message property of the exception? On what line does it occur? -- Charles Calvert Celtic Wolf, Inc. (703) 580-0210 [EMAIL PROTECTED] http://www.celticwolf.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
