Page 1 of 1

TIMER & DIALOG no me funcionan.

PostPosted: Thu Mar 16, 2006 8:50 am
by goosfancito
Estimados,

Ejecuto este código (indico que existe en un .res dialog_1) y no me funciona el timer, si lo hago con un WINDOWS en vez de un DIALOG funciona.

Code: Select all  Expand view
#Include "Fivewin.Ch"


FUNCTION Main()

   LOCAL oDlg, oTimer

   DEFINE DIALOG oDlg RESOURCE "DIALOG_1"

   Define Timer oTimer Interval 900 Action MsgInfo("Activado") OF oDlg

      Activate Timer oTimer

   ACTIVATE DIALOG oDlg

   oTimer:End()

RETURN (NIL)

PostPosted: Thu Mar 16, 2006 9:05 am
by Antonio Linares
Gustavo,

El handle del diálogo ha de existir. Así funciona:
Code: Select all  Expand view
#Include "Fivewin.Ch"

static oTimer

FUNCTION Main()

   LOCAL oDlg

   DEFINE DIALOG oDlg

   ACTIVATE DIALOG oDlg ;
      ON INIT BuildTimer( oDlg )

   oTimer:End()

RETURN (NIL)

function BuildTimer( oDlg )

   Define Timer oTimer Interval 900 Action MsgInfo("Activado") OF oDlg

   Activate Timer oTimer
   
return nil