Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is_run32 & mulitple instances
Message
 
À
17/07/2000 10:41:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00393284
Message ID:
00393303
Vues:
17
>Hi All,
>
>I have downloaded George's routine 'is_run32'. I have used it with no problems in programs that are running. Now I am trying to use it to block multiple instances of the calling program. In my main.prg I put this block long before I open any forms:
>
>* This is a call to a function to check and see if this program is already running
>exe_running = is_run32("Remote Process")
>
>* If the Function found that this program was already running
>* Block any multiple instances.
>IF exe_running > 0
> QUIT
>ENDIF
>
>"exe_running" always == 0. If I add a messagebox('anything') before that block. I always get the handle of the other instance.
>
>My question is, must my '.exe' have some prior interaction with windows for the function to work? If so, is there a way to do it without user involvement? Or will this only work once the form has been loaded?
>
>TIA
Mike,

I don't know how much help I can be here. I've never seen this type of behavior. FWIW, the code should have completed prior to the execution of the next line, so that the value of the variable should always be zero, if not found, and greater than zero if it is found.

One thought that I do have is that if you're trying to create a single instance application, you might want to look at my article on the subject that appeared in the Nov. 1998 issue of FoxPro Advisor. It, complete with the necessary code, is available on-line at the Advisor web site.
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