Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is_run32 & mulitple instances
Message
 
À
18/07/2000 14:01:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00393284
Message ID:
00393949
Vues:
17
>George,
>
>Even the 2nd, 3rd etc instances of the program GetLastError() returns 0.
>
>Have I set the thing up correctly? If so, must this all be done from a form not the main.prg?
>
>TIA
Mike,

You can store the class in a prg or vcx. The methods shown in the article (Init, Destroy and DisplayInstance) I think are all you need. In your main program, you should have code like this.
lcformcaption = _SCREEN.Caption
_SCREEN.Caption = ""
* Use only one of the next two lines.
SET PROCEDURE TO Mutex ADDITIVE && if in a prg
SET CLASSLIB TO Mutex ADDITIVE && if in a VCX
oMutex = CREATEOBJECT('Mutex', lcformcaption)
IF oMutex.nMutexErr # ERROR_ALREADY_EXISTS
  * Your normal setup code here. (DO MYMENU.MPR, READ EVENTS, etc.)
ELSE
  * If we hit this line, the other instance is displayed
  * and the current one released
  oMutex.DisplayInstance
ENDIF
Does this help?
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform