FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour rPreview does not close when app closes
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: rPreview does not close when app closes
Posted: Fri Feb 11, 2011 04:18 PM
reinaldocrespo wrote:Hi and thank you everyone. This is good brainstorming.

I think the following code incorporates from all of your ideas. It seems to do the trick. Please advise on your opinion:

Change Method Activate() on rPreview to:
Code (fw): Select all Collapse
     if ::oDevice:lPrvModal
        StopUntil( { || ::lExit .or. WndMain() == Nil .or. !IsWindow( WndMain():hWnd ) } )
     endif



This closes all the open rpreview windows when the main app is closed. Am I missing/forgetting/ommiting something?


Reinaldo.

This has the side effect of the preview window going behind the dialog where there is no wndMain() and the program is started with a dialog.

Test program:
Code (fw): Select all Collapse
#include "fivewin.ch"
procedure main()
   xbrowse( "\fwh\samples\customer.dbf" )
return



Before finalizing a modification to a program like RPreview, we need to test the code in all these cases:
1. MDI application
1.1 From MDICHILD (a) Modal and (b) Nonmodal
1.2 From a Dialog inside the app (a) Modal and (b) Nonmodal
2. Normal window
2.1 From Window (a) Modal and (b) Nonmodal
2.2 From a Dialog inside the app (a) Modal and (b) Nonmodal
3. App starting with a Dialog
3.1 From main dialog (a) Modal and (b) Nonmodal
3.2 From a subdialog (a) Modal and (b) Nonmodal
We also need to test any processes initiated by any button of the preview window in all the above cases.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion