Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling a multiple instances at load time
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00657565
Message ID:
00657736
Views:
45
>>>Michael, Thank you.
>>>
>>>My aplication has a variable window caption.
>>>So I'm thinking about using SYS(5)+SYS(2003) as a mutex name.
>>>Unfortunately, code in this article seems to be incomplete: I don't have FoxPro advisor.
>>>
>>>Is the mutex released automatically by OS if C5 error occurs at my VFP
>>>application startup ?
>>>
>>>>Check this out. http://www.advisor.com/Articles.nsf/AID/TASKG05
>>>>I've used it without trouble in VFP6 no idea about VFP7. Guess only George himself can say.
>>>>
>>>>HTH
>>>>Mike
>>
>>Andrus,
>>
>>I haven't had any problem with it under 7.0 SP1.
>>
>>The code in the article is as complete as I could make it given the formatting. Be sure, however, to include the properties shown in the class. Intentionally, the suggestion main program was simply an outline. If you have questions about anything, feel free to either post (preferable, since my home computer and ISP aren't getting along so well) or contact me directly.
>>
>>As for releasing the mutex after a C5 error, that's problematical. I've seen instances both ways. Fortunately, however, for me, this is a rare occurence, and a simple re-boot, of course, resolves the situation if it exists. I can't, however, recall the last time one occurred.
>
>George,
>
>thank you for reply.
>
>I have the following typical situation:
>
>1. User enter a lot of data
>2. VFP crashes for some reason or computer power goes down
>3. .cdx files are corrupted in this case
>4. User re-runs an application and application sets a mutex.
>5. Now C5 error occurs immediately:
>VFP 7 applicaton tries to open a table with corrupted cdx file under Win 98.
>It does not occur in FoxPro For Windows and under Windows 2000.
>I posted a reproducible sample about this in UT some time ago.
>Re-boot does not fix this error.
>
>6. Since it is not possible to dedect cdx corruption programmatically without
>opening cdx file, it is not possible to fix this problem in my code.
>
>So user calls a phone support and is directed to delete all cdx files manually. It takes a lot of time to explain cdx file deletion for users.
>Sometimes users delete data files also and this causes total loss of data.
>
>Maybe application must check for shift key to be pressed at startup and delete all cdx files if shit key is hold down ?
>
>Can you confirm that mutex remains set in this case ?
>I think taht OS must release mutex even after application crashes with C5 error, isn't so ?

Andrus,

Forgive the delay in my reply. I have, however, given considerable thought to your problem.

I've seen the mutex not be released on an abnormal shutdown, but it's impossible for me to re-produce. I agree completely that the OS should release it. You might want to look at Ed Rauh's solution to creating a single instance application, however. He creates an event, and, AFAIK, that event always gets release regardless of the termination.

I've got to leave now, but I'll post back tomorrow on this and your other post to me with the ideas that I've had.

Regards,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform