error close DIALOG

error close DIALOG

Postby Dorneles » 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: Select all  Expand view

#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
///////////////////////////////////////////////////////////////////////////////
 
Dorneles
 
Posts: 30
Joined: Mon Oct 30, 2006 2:39 pm
Location: Brasil

Re: error close DIALOG

Postby James Bott » Mon Oct 26, 2009 3:59 am

Code: Select all  Expand view
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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 89 guests