Ch
Mon Sep 20 15:14:29 CDT 2004
Hi Lee!
Thank you! I downloaded the FirstInstance.prg and connected it to my
project. Four rows
early in my startprg;
IF !FirstInstance()
WAIT 'The app is already running' WINDOW
QUIT
ENDIF
It results in two errormessages;
1 API library is not found
2 File mainhwnd.prg does not exist
After ignoring them it works as supposed with an exeption for the "bring to
front" feature which didn´t work.
What´s missing? How can I avoid the errors and how can I have the "bring to
front" feature to work.
Regards
Christina
"Lee Mitchell" <Leemi@online.microsoft.com> skrev i meddelandet
news:DV6zdlxnEHA.2932@cpmsftngxa06.phx.gbl...
> Hi Christina:
>
> Take a look at the FirstInstance.prg available from Universalthread.com.
Go
> to www.universalthread.com, click on the Download icon, and choose Visual
> FoxPro as the product. In the ID text box of the query page, search for
> "9497.
>
> I hope this helps.
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> Sincerely,
> Microsoft FoxPro Technical Support
> Lee Mitchell
>
> *-- VFP9 Public Beta Now Available!! --*
> Download the VFP9 beta here:
http://msdn.microsoft.com/vfoxpro/
>
> *-- VFP8 HAS ARRIVED!! --*
> Read about all the new features of VFP8 here:
>
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
> Purchase VFP8 here:
>
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
>
> Keep an eye on the product lifecycle for Visual FoxPro here:
>
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
> - VFP5 Mainstream Support retired June 30th, 2003
> - VFP6 Mainstream Support retired Sept. 30th, 2003
>
> >Hi all!
>
> >I was told that one way to prevent an user to open more than one instance
> of
> >an app is to try to FLOCK() a file which is allready locked by the first
> >instance.
>
> >I created a dummy file tlbTmp.dbf with one field only for this purpose.
But
> >the second attempt to FLOCK() doesn´t return .F. as supposed. A file
> >allready locked can be locked again and again and FLOCK() returns .T.
> >everytime.
>
> >What is the trick to have this solution to work as supposed?
>
> >Best regards
> >Christina
>