Error FiveWin/6 Cannot create window or control

Error FiveWin/6 Cannot create window or control

Postby concentra » Mon Nov 14, 2005 10:28 am

I´m getting the error :
"Error FiveWin/6 Cannot create window or control"
Could anyone explains why can´t I do this ?
Sample code :


#INCLUDE "FIVEWIN.CH"

PROCEDURE MAIN()
oDLG_MAIN := TWINDOW():NEW(,,,,"Test")
ACTIVATE WINDOW oDLG_MAIN ON INIT( TEST2() )
RETURN NIL

FUNCTION TEST2()
LOCAL oDialog
DEFINE DIALOG oDialog TITLE "Test2"
DEFINE MESSAGE oMessage OF oDialog PROMPT "Test2 Footer"
ACTIVATE DIALOG oDialog
RETURN
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: Error FiveWin/6 Cannot create window or control

Postby Enrico Maria Giordano » Mon Nov 14, 2005 10:38 am

Code: Select all  Expand view
#INCLUDE "FIVEWIN.CH"

PROCEDURE MAIN()
LOCAL oDLG_MAIN := TWINDOW():NEW(,,,,"Test"), oMessage
ACTIVATE WINDOW oDLG_MAIN ON INIT( TEST2() )
RETURN

FUNCTION TEST2()
LOCAL oDialog, oMessage
DEFINE DIALOG oDialog TITLE "Test2"
//DEFINE MESSAGE oMessage OF oDialog PROMPT "Test2 Footer"
ACTIVATE DIALOG oDialog ON INIT TEST3( oDialog )
RETURN NIL

FUNCTION TEST3( oDialog )

    LOCAL oMessage

    DEFINE MESSAGE oMessage OF oDialog PROMPT "Test2 Footer"

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Error FiveWin/6 Cannot create window or control

Postby concentra » Wed Nov 16, 2005 1:02 am

EnricoMaria wrote:
Code: Select all  Expand view
#INCLUDE "FIVEWIN.CH"

PROCEDURE MAIN()
LOCAL oDLG_MAIN := TWINDOW():NEW(,,,,"Test"), oMessage
ACTIVATE WINDOW oDLG_MAIN ON INIT( TEST2() )
RETURN

FUNCTION TEST2()
LOCAL oDialog, oMessage
DEFINE DIALOG oDialog TITLE "Test2"
//DEFINE MESSAGE oMessage OF oDialog PROMPT "Test2 Footer"
ACTIVATE DIALOG oDialog ON INIT TEST3( oDialog )
RETURN NIL

FUNCTION TEST3( oDialog )

    LOCAL oMessage

    DEFINE MESSAGE oMessage OF oDialog PROMPT "Test2 Footer"

    RETURN NIL


EMG


Ok, it works.
But, why can´t I do the previous code ?
If I program a WINDOW other than a DIALOG, the code works OK, like:

Code: Select all  Expand view
DEFINE WINDOW oDialog TITLE "Test2"
DEFINE MESSAGE oMessage OF oDialog PROMPT "Test2 Footer"
ACTIVATE DIALOG oDialog ON INIT TEST3( oDialog )


Why can I do this with a WINDOW and not with a DIALOG ?
Isn´t a DIALOG a WINDOW sub-class ?
It can seems to be a stupid question, but, I am just triing to understand...
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: Error FiveWin/6 Cannot create window or control

Postby Enrico Maria Giordano » Wed Nov 16, 2005 7:54 am

A WINDOW and a DIALOG are different things from the API point of view. Therefore you can't use a DIALOG exactly as it were a WINDOW.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests