A problem, REOPEN a Dialog with a included Folder-resource.

A problem, REOPEN a Dialog with a included Folder-resource.

Postby ukoenig » Wed Oct 01, 2008 11:30 am

Hello,

In a very big application i get a Error on reopen a dialog with Folder.
Everything works fine, but if i close the main-dialog and open it again,
i get a folder error.
To define extra Functions for each folder,
( to big to keep all pages in the main-dialog )
cannot be the reason, because i tested this in other applications and it works fine there.

Code: Select all  Expand view

Application
===========
Path and name: D:\T_XBROW\brwtools.exe (32 bits)
Size: 1,958,400 bytes
Time from start: 0 hours 0 mins 7 secs
Error occurred at: 10/01/08, 13:19:30
Error description: Error BASE/1004  Message not found: TFOLDER:NCOUNT

Stack Calls
===========
Called from: source\rtl\tobject.prg => TFOLDER:ERROR(172)
Called from: source\rtl\tobject.prg => TFOLDER:MSGNOTFOUND(205)
Called from: source\rtl\tobject.prg => TFOLDER:NCOUNT(0)
Called from: .\source\classes\WINDOW.PRG => TFOLDER:SETFONT(0)
Called from: .\source\classes\folder.PRG => TFOLDER:REDEFINE(0)
Called from: .\Brwtools.PRG => TOOLS(614)
Called from: .\Brwtools.PRG => (b)MAKEBAR1(458)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(0)
Called from:  => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from:  => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(0)
Called from: .\Brwtools.PRG => MAIN(437)

// --------- A sample structure of the source ----------------

#include "FiveWin.ch"
#include "xBrowse.ch"
#include "Folder.ch"

FUNCTION Main()
LOCAL oWnd := WndMain()

DEFINE WINDOW  oWnd  TITLE "Test" 

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT  MAKEBAR1( oWnd ) 

RETURN NIL

// ---------- Open the Dialog from a Button-Bar ----------------

FUNCTION MAKEBAR1( oWnd )
LOCAL oBar1, oBtn1

DEFINE BUTTONBAR oBar1 OF oWnd SIZE 70, 80 2007 RIGHT

DEFINE BUTTON oBtn1 OF oBar1 ACTION TestFolder() ;
RESOURCE "gear" PROMPT "Template" TOOLTIP "Create"

RETURN( NIL )

//-----------------  DIALOG ---------------------------------------

STATIC FUNCTION TestFolder()
LOCAL oDlg, oFld, oBtn1

DEFINE DIALOG oDlg RESOURCE "MainDlg" TITLE  "Folder-Test"

REDEFINE FOLDER oFld ID 110 OF oDlg ;
PROMPTS "  1  ", "  2  ", "  3  ", "  4  ", "  5  ", " 6 ", " 7 "  ;
DIALOGS "Brw1","Brw2","Brw3","Brw4","Brw5","Brw6","Brw7"

PAGE_1(oDlg,oFld)
PAGE_2(oDlg,oFld)
PAGE_3(oDlg,oFld)
PAGE_4(oDlg,oFld)
PAGE_5(oDlg,oFld)
PAGE_6(oDlg,oFld)
PAGE_7(oDlg,oFld)

REDEFINE BUTTONBMP oBtn1  ID 30 OF oDlg ;
ACTION ( oDlg:End() ) ;
BITMAP "quit" PROMPT SPACE(10) + "&Exit" TEXTRIGHT
oBtn3:cToolTip =  { "Close the" + CRLF + "Template" + CRLF + ;
               "Dialog","Close the Dialog", 1, CLR_BLACK, 14089979 }

ACTIVATE DIALOG oDlg CENTERED

RETURN ( NIL )



Maybe, i have to use a different structure to solve the problem ?

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Antonio Linares » Thu Oct 02, 2008 10:24 am

It looks like the DATA oFont is already nil.

Try to assign it a new font.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Folder-Error

Postby ukoenig » Thu Oct 02, 2008 11:24 am

Antonio,

Thank you very much.
Your solution works.

The Font oProgfont ( defined for the dialog ) was the problem.
Not the folder.

The Font-define before :

PRIVATE oProgFont := TFont():New("Arial",,-14,.F.,.F. ,,,,.F. )

DEFINE WINDOW oWnd TITLE "Test"
....
....

DEFINE DIALOG oDlg RESOURCE "MainDlg" TITLE "Test" FONT oProgFont
....
....

The font was defined before the Windows-define
It seems, after reopen the dialog oProgFont is NIL.
If i don't use the font for the dialog, the problem is solved.

New :

STATIC FUNCTION Tools()
LOCAL oDlg, oFld, oBrush

oProgFont := TFont():New("Arial",,-14,.F.,.F. ,,,,.F. )

DEFINE DIALOG oDlg RESOURCE "MainDlg" TITLE "xBROWSE-Color-Selection" FONT oProgFont

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests