Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is_run32 & mulitple instances
Message
 
To
18/07/2000 14:56:26
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00393284
Message ID:
00393982
Views:
13
>George,
>
>This is what I had:
>
>#DEFINE ERROR_ALREADY_EXISTS 183
>LOCAL oMutex, lcformcaption
>lcformcaption = "Remote Processing Program" && Even if I put _SCREEN.CAPTION I get the same result
>SET PROCEDURE TO Mutex ADDITIVE
>oMutex = CREATEOBJECT('Mutex', lcformcaption)
>
>IF oMutex.nmutexerror # ERROR_ALREADY_EXISTS
> *!* Some code
>ELSE
> omutex.displayinstance()
>ENDIF
>
>Could it be the way I define the class? This is the complete mutex.prg:
>
>DEFINE CLASS mutex AS CUSTOM
> * The 3 properties used in the 'INIT' procedure
> cformcaption = ""
> hmutex = 1
> nmutexerror = 0
>
>PROCEDURE INIT
> * the exact code from the article
>PROCEDURE displayinstance
> * same
>PROCEDURE DESTROY
> * same
>ENDDEFINE
>
>I'm Stumped
Mike,

It looks fine to me. I did have a thought or two, however. First, is the oMutex object being destroyed (oMutex = .NULL.) anywhere except the last of the main program? If so, the mutex will be destroyed then, and subsequent attempts to create it, will be successful. Once the mutex object is created, it must exist through the life of the program. For example, you can't issue a CLEAR ALL anywhere. Second, is this an SDI application (Top-Level form)?
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform