FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour error close DIALOG
Posts: 30
Joined: Mon Oct 30, 2006 02:39 PM
error close DIALOG
Posted: Sun Oct 25, 2009 12:59 PM
When I close the DIALOG without closing the WINDOWS of an error, how to get you close to the DIALOG Program also close, or not happen the error.

Code (fw): Select all Collapse
#INCLUDE "FIVEWIN.CH"

FUNCTION MAIN()

   LOCAL oDlg

   DEFINE DIALOG oDlg                                       ;
      FROM 1, 1 TO 10, 30


   ACTIVATE DIALOG oDlg CENTERED ON INIT(PortalNFe())

RETURN NIL

/////////////////////////////////////////////////////////////////////////////// 
FUNCTION PortalNFe()
///////////////////////////////////////////////////////////////////////////////   

   Local oActiveX,oWndNfe

    DEFINE WINDOW oWndNfe FROM 3, 2 TO 26, 98 TITLE "Portal Nacional da Nota Fiscal Eletrônica" //OF oWnd//of ofld
    
    oActiveX = TActiveX():New( oWndNfe, "Shell.Explorer" )

   oWndNfe:oClient = oActiveX 

   oActiveX:Do( "Navigate", "https://www.nfe.fazenda.gov.br/portal/FormularioDePesquisa.aspx?tipoconsulta=completa" )
   ACTIVATE WINDOW oWndNfe
   
   EndDialog()
       
RETURN nil
///////////////////////////////////////////////////////////////////////////////
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: error close DIALOG
Posted: Mon Oct 26, 2009 03:59 AM
Code (fw): Select all Collapse
ACTIVATE WINDOW oWndNfe
   
EndDialog()


Remember that windows are non-modal so the EndDialog is called as soon as the window is activated, which is not what you wanted.

Try this:

ACTIVATE WINDOW oWndNfe valid EndDialog()

This way EndDialog() is only called when the user closes the window.


Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion