>>>Hi all,
>>>How can avoid run two or more instances of an application in the same station...
>>>
>>>Thanks.
>>
>>Hi William,
>>
>>Vlad Tatavu has a class available in the download section that will allow you to setup a program that can only be run once. That's one way. Or you can download my Is_Run32 program and use that to check for another existence of an application. This method is similar to the way the MS KB article approaches it. Or (if you can wait until next month) you can read my article "Creating Single Instance Applications" in the October issue of FoxPro Advisor. This uses another method, namely, the one recommended by the Win32 SDK.
>>
>>hth.
>.....I almost forget, I'm trying to implement this feature (one at a timee) on Fox Pro Windows 2.6.
In that case, the old indian trick goes like this:
in config.fpw
resource=off
In start prg:
set reso off
NoGo=.f.
on error NoGo=.t.
use (set("resource",1) again excl
use
if NoGo
quit
endif
set resource on
Only make sure every instance of your app should attempt to open the same resource file; the easiest way is to have a foxuser.dbf on the local disk, and have a
resource=c:\MyPath\foxuser.dbf
in your app's config.fpw. It's a bit hard to provide the same directory and disk for every workstation (if this is a single-machine app, skip this), but it's manageable.