Hi there.

You may want to consider using a mutex instead a semaphore file. A mutex is 
created upon application's startup and resides in memory as long as the app 
runs. When app is shut down (or it's process is killed in any way), the 
mutex is released automatically by the OS.

I don't have the code handy (I'm on a friend's computer now) but as soon as 
I get to my computer I'll send a piece of code that does that.

Thanks.


----- Original Message ----- 
From: "Ken Dibble" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 30, 2007 7:24 PM
Subject: Where Do Files Go When Sent to the Vista Windows Folder?


> Hi Folks,
>
> I've got two issues here.
>
> 1. My application creates a semaphore .txt file in either the \WINNT 
> folder
> or \Windows folder, depending on which the OS uses. This file is used to
> prevent multiple instances of the program from running. If the application
> does not shut down gracefully, this file doesn't get erased, and the
> application can't be restarted. The solution is simply to delete the file.
> Someone, despite my recommendation, installed the application on Vista. 
> The
> application crashed and she can't find the file. I'm not discounting the
> strong possibilities that this semi-computer-literate person doesn't know
> how to properly conduct a file search, or navigate the file system--or
> perhaps the Vista file-search module is buggy like XP's was. She said she
> would keep looking for the file. But if she calls me back I'd like to have
> something to tell her.
>
> I don't have Vista to test on. I (belatedly) understand that it has a
> Windows folder but that applications supposedly can't write to it.
>
> My application definitely wrote the file, because that's the only way 
> she'd
> get the message saying the application is "already running" that my
> application displays when it finds that semaphore file in either \Windows
> or \WINNT.
>
> So--if this is another example of the Vista "virtualization" nightmare,
> where else might she look for this file?
>
> 2. The application was abruptly shut down in an unfriendly manner during a
> Windows automatic update. The application has an ON SHUTDOWN routine that
> should have caused a graceful exit, including closing tables, closing
> windows, logging the user out and erasing that semaphore file, but it
> didn't--and I've seen this before with VFP on other OSes. Despite the ON
> SHUTDOWN, VFP either doesn't shutdown and the OS shutdown hangs, or the OS
> shuts down, killing my app in a disorderly way.
>
> This seems to be due to the fact that the VFP event sequence doesn't 
> always
> work as advertised. During a normal shutdown, everything goes just fine.
> But introduce something unexpected into the mix and suddenly the shutdown
> process gets scrambled--we go waaaayyy back up the stack to some method
> that should have terminated five or ten steps ago, long after CLEAR EVENTS
> was issued, and find it's still live. It's not a dangling object
> reference--all the objects are gone, and anyway, all of my classes that 
> use
> composition to add member objects on the fly explicitly remove them when
> they are destroyed. Over the years I've seen a lot of stuff about ON
> SHUTDOWN online, but I've never seen a definitive explanation for this.
>
> Obviously, I've told this user either to turn off automatic updates or
> don't run the program when they know an update is scheduled. But it would
> be helpful for one of the really big VFP gurus to provide a definitive
> explanation of this.
>
> Thanks for any insights.
>
> Ken Dibble
> www.stic-cil.org
>
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to