Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force shutdown

Status
Not open for further replies.

EzLogic

Programmer
Aug 21, 2001
1,230
US
I have an app in vfp9 sp2

I have a shutdown method that forces people out of the app if i drop a file in the folder.

it seems to close all the apps perfectly for reports, forms, etc..

the only problem i have is, if a user has a Messagebox() poped up and they never clicked on it.

how do i force the messagebox to cancel/close?



Ali Koumaiha
TeknoSoft Inc.
Michigan
 
I just did a Google search for:
"Foxpro Advisor" 2007 forced shutdown

There were a number of 'finds' where an Andrew Ross MacNeill references Mike's article and shows code. I don't know if that is Mike's code from the original article or something Andrew came up with using Mike's suggestions.

Regardless, it may be a path to a solution.

Good Luck,
JRB-Bldr


 
Looked up the January 2007 article ( p26 , with a picture of a very youthful Mr Lewis ) , in effect uses the native VFP timer with a semaphore file ,options for users etc . But does not address the issue that the thread frist raised i.e. the VFP timer is "dead" while another modal form is open . I've come across also the same issue with an old-style Get waiting for input , result , some-one still has to kill sessions on server or do a run-around.

Trust me , check this link , this timer works even when modal windows/gets are active ,the timer WILL kick in , and the rest of the code is the same as before i.e. watching for some semaphore file etc
 
Thanks to those of you who searched for the article. I have it in front of me now.

Sean, you say the article didn't address the issue of closing the app when another modal form is open. In fact, that's why I suggested using ExitProcess(), as I mentioned earlier in this thread.

I'm not saying this is the ideal solution, but it is the one I have adopted - and also for my error-handler - and it has so far worked well enough.

On another point: You say the photo is "a very youthful Mr Lewis". How do you know? For all you know, I still look like that.

In the words of the poet: Tempus fugit, tempest bebende.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike , u could be right , at the time I hit this problem , here was was my code ( pseudo )

1) set up timer to watch for semaphore file ,every 10 secs
2) if found , do some code , kill all , quit , exitprocess ,whatever

prob was that if message/get was active , the 10-sec timer did NOT kick in , so did not matter what code was there , part of the prob was the app was a mix of old/new , and am pretty sure the old-style get was the issue , anyhow hope this was of interest to the poster .

By the way ,in looking back at old library of Advisor , am struck by how well the front-page summary is a superb knowledge-base of all things VFP , maybe some VFPX project might pick up on this
 
Sean,

You might be right about the timer not kicking in. If memory serves, I originally had a timeout on the messageboxes in case the user had gone home when the shutdown started (as would often be the case). But I found that timers never fired when a messagebox with a timeout was active. I tend not to use them any more.

But ExitProcess should work, even if a messagebox is active (at least, I think that's right; I don't recall for sure).

Regarding the old FPA library, it would be great is someone would produce a professional index of all the back copies. I've got copies going back to 1996, and it's a pain to search them manually. It would be even better if Advisor Publications would make the full text freely available on-line.

Then again, there can't be many people who would use it, so I suppose there's no great incentive for them to do so.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
U've mentioned a few times , that u still have a full revenue stream from VFP , ditto , and would like to see that go on another 10 years after 2014. I wonder are there enough of us around to make some kind of professional paid-up group and we could pay for this kind of thing to be done / keep us all in biz. VFP has been good to me , I've no prob paying some back . Are there are any avenues for this kind of request to be raised at the next SQ Fox ( u might have contacts )
 
Hi Dan , not suggesting that FPA be revived just that would be great if there was a way to view/search the archives. Yes I did subscribe to FoxRockx but cancelled as it included nothing new of interest ( as some-one said , VFP is not dead , it is done ) , but there is an absolute wealth of info/tech/code etc in the 10 years or so of FPA , all of it still 100% relevent. Both Mike/I are UK based , prob like most VFP'ers are ' mature' one-men-shows and work with small/mid business for whom Fox is still far ahead of dotNet in terms of performance/cost of dev apps etc . Only prob is perception , we are all afraid to even use the F word to any-one half-techie ; some kind of professional group we could all subscribe to could give the end-user biz customer the confidence to use this product for another 10 years. any-how , just an idea

Sean M
 
Sean - It strikes me that an index of the sort you propose might fit in at VFPX as a resource. You might propose such a project over there and see if you get any traction.

Tamar
 
Tamar , much as would like to travel to SWFOX , am Ireland-based so a leetle expensive. I see that Steve Black is giving some session on future 'niches' etc , am quite convinced that an FPA /VFPX index would add many years to VFP , might be relevent to that session + idea of some kind of professionsl VFP body ?.

Would greatly appreciate if you might canvas these ideas if you plan to travel to SW, many thanks , Sean M
 
I suggest you start a discussion at VFPX ( to see whether there's a group of people who would be willing to make the effort needed.

I've been working on pulling together data for just my own articles, and it's quite a job.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top