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!

How to Close Application Window - Ain't working

Status
Not open for further replies.

IRABYY

Programmer
Apr 18, 2002
221
US
wgcs:

I tried your test program in the FAQ, just copy-pasted the code and followed your instructions "by the book". As you could guess from the title - ain't working:

VFP gives me "Invalid subscript reference" error message before executing a single line. I even put in "SET STEP ON" at the top - same thing.

I'm running VFP 7.0 SP1, if that has any relevance to the matter.

What I might be doing wrong?

(Mike Gagnon, who helped wgcs to develop this sample, is more than welcome to step in here also.)

Regards,

Ilya


 
Ilya,
Are you refering to faq184-2725? Which code did you use the WSH code or the API calls? It's difficult to know what's wrong if we don't know what you've actually tried.

Rick
 
rgbean (Programmer)
Ilya,
Are you refering to FAQ184-2725?


Sorry, colleagues, mea culpa!

Yes, this one, FAQ184-2725.

Which code did you use the WSH code or the API calls?

The API calls.

Sorry again for not providing enough info. It's one of those days when nothing goes righ, y'know... [smile]

Regards,

Ilya

 
Ilya,
I just tried the code in both VFP 7.0 SP1 and VFP 8.0 (public beta), and it worked as it was described.

I created a CLOSEWINDOW.PRG file in the "2nd" copy of VFP, pasted the code into, and then commented out the first line so it looks like:
Code:
*PROCEDURE CloseWindow

And the last line in this file is:
Code:
return Str(wndDialog,10)+str(wndButton,10)

The returned information in the "2nd" copy (where you actually call CLOSEWINDOW), prints a pair of numbers that a really not useful at this point. In the "1st" window the code displayed 3, 4, 5 - the values that the messagebox returns when you pick "&Abort", "&Retry", and "&Ignore".

Note: I'm running XP Pro, but the API calls used should work in any 32-bit OS.

Rick
 
Rick:

I just repeated all the steps again, and - strange as it sounds - it worked as supposed to this time 'round.
I used a bit different "technique", though:

DO <FullPath>\CloseWin.PRG WITH &quot;Special&quot;, &quot;&Abort&quot;

instead of

?CloseWin(&quot;Special&quot;, &quot;&Abort&quot;)

as in previous attempts. I guess it has something to do with the default path...

Well, all's well that ends well, right? [2thumbsup]

Thank you very much, Rick!

Problem's been resolved, case's closed.

All the best wishes to you, colleague!

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top