FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index Bugs report & fixes / Informe de errores y arreglos TPrinter with GetWndDefault()
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TPrinter with GetWndDefault()
Posted: Sat Jan 12, 2008 10:35 PM
In the following sample GetWndDefault() returns NIL after TPrinter is used and then it continues to return NIL:

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON "Print";
           ACTION PRINT()

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


STATIC FUNCTION PRINT()

    LOCAL oPrn

    ? GETWNDDEFAULT()

    PRINT oPrn PREVIEW MODAL
        PAGE
        ENDPAGE
    ENDPRINT

    ? GETWNDDEFAULT()

    RETURN NIL


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TPrinter with GetWndDefault()
Posted: Sun Jun 08, 2008 06:35 PM

This bug is still unresolved.

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TPrinter with GetWndDefault()
Posted: Sat Jul 26, 2008 10:46 AM

Any news?

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: TPrinter with GetWndDefault()
Posted: Sat Nov 28, 2009 09:27 PM

Any news about this problem?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TPrinter with GetWndDefault()
Posted: Thu Dec 03, 2009 10:33 AM

Enrico,

GetWndDefault() returns the most recently used window or dialog, so once the preview window is created then GetWndDefault() changes and finally it set to nil and the preview window is destroyed.

We don't keep a stack of previously used windows. In case you need to locate the current one you may use:

oWndFromHwnd( GetFocus() ) or

oDlgFromHwnd( GetFocus() )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: TPrinter with GetWndDefault()
Posted: Thu Dec 03, 2009 11:27 AM

Ok, thank you.

EMG

Continue the discussion