Page 1 of 1

dialog error

Posted: Wed Jan 17, 2007 3:11 pm
by Silvio
when I compile it the procedure let me "cannot create dialog" but I NOt understand what is wrong !!!!!!!

the code

Code: Select all

#include "FiveWin.ch"

function main()
Local oDlg,oFld


DEFINE DIALOG oDlg RESOURCE "AGENDA_EDIT"

REDEFINE FOLDER  ID 500 OF oDlg                         ;
                        PROMPT "&Anagrafica","&Dettagli","&Notizie mediche","&Fotografia","&Osservazioni";
                        DIALOGS "AGENDA_EDIT_A", "AGENDA_EDIT_B", "AGENDA_EDIT_C","AGENDA_EDIT_D","AGENDA_EDIT_E"


 ACTIVATE DIALOG oDlg CENTERED

return nil



the resource

Code: Select all


AGENDA_EDIT DIALOG 33, 36, 332, 244
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "AGENDA_EDIT"
FONT 8, "MS Sans Serif"
{
 LTEXT "Socio :", 200, 85, 14, 30, 8
 EDITTEXT 105, 120, 12, 174, 12
 CONTROL "", 500, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE, 13, 69, 313, 136
 PUSHBUTTON "&Conferma", 1, 220, 218, 50, 16
 PUSHBUTTON "&Annulla", 2, 276, 218, 50, 16
 LTEXT "Codice :", -1, 13, 13, 30, 8
 EDITTEXT 101, 48, 12, 33, 12
 CONTROL "", 104, "TBitmap", 0 | WS_CHILD | WS_VISIBLE, 300, 12, 12, 11
 CONTROL "", 10, "SysDateTimePick32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 66, 30, 81, 12
 LTEXT "Data richiesta :", -1, 13, 32, 51, 8
 LTEXT "Iscrizione :", -1, 172, 32, 38, 8
 CONTROL "", 11, "SysDateTimePick32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 213, 30, 81, 12
 LTEXT "Tipo adesione :", -1, 12, 49, 52, 8
 CONTROL "220", 220, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 66, 47, 84, 62
 LTEXT "Status : ", -1, 162, 49, 27, 8
 CONTROL "220", 12, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 193, 47, 54, 74
 LTEXT "Tessera :", -1, 254, 50, 34, 8
 EDITTEXT 13, 290, 48, 37, 12
}

AGENDA_EDIT_D DIALOG 29, 69, 312, 122
STYLE WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
FONT 8, "MS Sans Serif"
{
 CONTROL "", 101, "TImage", 0 | WS_CHILD | WS_VISIBLE, 218, 18, 73, 86
 CONTROL "TBtnBmp", 103, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE, 180, 26, 12, 12
 CONTROL "TBtnBmp", 102, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE, 164, 26, 12, 12
 EDITTEXT 100, 6, 10, 187, 12
 GROUPBOX "", 501, 202, 7, 103, 111, BS_GROUPBOX
 LTEXT "Taglia : ", -1, 27, 40, 35, 8
 CONTROL "S", 104, "BUTTON", BS_AUTORADIOBUTTON, 71, 43, 60, 12
 CONTROL "M", 105, "BUTTON", BS_AUTORADIOBUTTON, 71, 56, 60, 12
 CONTROL "L", 106, "BUTTON", BS_AUTORADIOBUTTON, 71, 69, 60, 12
 CONTROL "XL", 107, "BUTTON", BS_AUTORADIOBUTTON, 132, 43, 60, 12
 CONTROL "XXL", 108, "BUTTON", BS_AUTORADIOBUTTON, 132, 56, 60, 12
 CONTROL "XXXL", 109, "BUTTON", BS_AUTORADIOBUTTON, 132, 69, 60, 12
 LTEXT "Quota associativa : ", -1, 6, 86, 60, 8
 EDITTEXT 110, 70, 84, 53, 12
 LTEXT "Versato anno corrente :", -1, 6, 106, 80, 8
 CONTROL "Si", 111, "BUTTON", BS_AUTORADIOBUTTON, 93, 105, 23, 12
 CONTROL "No", 112, "BUTTON", BS_AUTORADIOBUTTON, 124, 106, 23, 12
}

AGENDA_EDIT_A DIALOG 29, 69, 312, 122
STYLE WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
FONT 8, "MS Sans Serif"
{
 EDITTEXT 100, 48, 12, 260, 12
 EDITTEXT 101, 48, 29, 157, 12
 LTEXT "Indirizzo :", -1, 12, 12, 36, 8
 LTEXT "Località :", -1, 12, 30, 33, 8
 EDITTEXT 103, 278, 29, 30, 12
 LTEXT "Cap :", -1, 257, 31, 18, 8
 EDITTEXT 102, 237, 29, 17, 12
 LTEXT "Prov.:", -1, 215, 31, 21, 8
 LTEXT "Data di nascita :", -1, 13, 68, 55, 8
 EDITTEXT 105, 78, 66, 74, 12
 LTEXT "Luogo di nascita :", -1, 13, 50, 63, 8
 EDITTEXT 104, 78, 49, 230, 12
 LTEXT "Sesso :", -1, 211, 68, 33, 8
 COMBOBOX 106, 254, 66, 54, 33, CBS_DROPDOWNLIST | WS_TABSTOP
 LTEXT "Telefono :", -1, 13, 87, 35, 8
 LTEXT "Cellulare :", -1, 13, 104, 38, 8
 EDITTEXT 107, 78, 86, 74, 12
 EDITTEXT 109, 78, 103, 74, 12
 LTEXT "Telefono", -1, 187, 88, 35, 8
 LTEXT "Cellulare ", -1, 187, 105, 29, 8
 EDITTEXT 108, 226, 86, 82, 12
 EDITTEXT 110, 226, 103, 82, 12
}


AGENDA_EDIT_B DIALOG 29, 69, 312, 122
STYLE WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
FONT 8, "MS Sans Serif"
{
 LTEXT "Professione :", -1, 13, 14, 60, 8
 LTEXT "Sede lavorativa :", -1, 13, 31, 60, 8
 LTEXT "Telefono sede lavorativa : ", -1, 11, 53, 87, 8
 EDITTEXT 200, 103, 15, 144, 12
 EDITTEXT 201, 103, 33, 145, 12
 EDITTEXT 202, 103, 52, 146, 12
}


AGENDA_EDIT_C DIALOG 29, 69, 312, 122
STYLE WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
FONT 8, "MS Sans Serif"
{
 LTEXT "Data del certificato medico :", -1, 19, 14, 93, 8
 EDITTEXT 300, 116, 13, 93, 12
 LTEXT "Medico curante /sportivo :", -1, 19, 34, 92, 8
 EDITTEXT 301, 116, 33, 183, 12
 LTEXT "Gruppo sanguigno :", -1, 19, 57, 68, 8
 EDITTEXT 302, 116, 55, 62, 12
 LTEXT "Donatore :", -1, 21, 83, 60, 8
}

AGENDA_EDIT_E DIALOG 29, 69, 312, 122
STYLE WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
FONT 8, "MS Sans Serif"
{
 GROUPBOX "", 501, 4, 4, 301, 111, BS_GROUPBOX
 LTEXT "&Note :", 201, 22, 12, 30, 8
 EDITTEXT 600, 20, 22, 274, 81, ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_BORDER | WS_VSCROLL | WS_TABSTOP
}

GET_MEMO DIALOG 84, 92, 261, 73
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
{
 EDITTEXT 101, 6, 4, 252, 50, ES_MULTILINE | ES_UPPERCASE | ES_WANTRETURN | WS_BORDER | WS_VSCROLL | WS_TABSTOP
 PUSHBUTTON "&Conferma", 111, 83, 58, 89, 13
}



the error

Code: Select all

Application
===========
   Path and name: C:\work\errori\fsdi2006\prg\testgar.Exe (32 bits)
   Size:   435,200 bytes
   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 01/17/07, 16:10:11
   Error description: Error FiveWin/3  Cannot create Dialog Box: 
                      Resource: AGENDA_EDIT

Stack Calls
===========
   Called from:  => CREATEDLGERROR(0)
   Called from: DIALOG.PRG => TDIALOG:ACTIVATE(0)
   Called from: testgar.prg => MAIN(15)
somene can help me ??????????????


thanks in advance !!!!!!!!

Re: dialog error

Posted: Wed Jan 17, 2007 4:30 pm
by Taavi
>when I compile it the procedure let me "cannot create dialog" but I NOt >understand what is wrong !!!!!!!
>thanks in advance

Hi,
try changing dialog resource names to be more different (not to have so much matching characters). Seems like some resource ID generation bug (or effect)... There was a discussion about this sub. in Xharbour newsgroup.

Taavi.

Posted: Wed Jan 17, 2007 5:18 pm
by Antonio Linares
Silvio,

You are using a TImage, TBtnBmp and TBitmap in your resource and you have not redefined them in your PRG

Posted: Wed Jan 17, 2007 5:40 pm
by Silvio
Antonio,

On my program I redefine all fields ( TImage, TBtnBmp and TBitmap ), but it not show the dialog!!!!

I had had problem when I insert date control 32 bit

if yo want can erase all TImage, TBtnBmp and TBitmap control

IT NOT show the dialog


try it please :

Code: Select all

#include "FiveWin.ch"
#Include "Image.Ch"

function main()
   Local oDlg,oFld

  LOCAL aDat[28],oDat[28]

DEFINE DIALOG oDlg RESOURCE "AGENDA_EDIT"

                          REDEFINE FOLDER  ID 500 OF oDlg                         ;
                        PROMPT "&Anagrafica","&Dettagli","&Notizie mediche","&Fotografia","&Osservazioni";
                        DIALOGS "AGENDA_EDIT_A", "AGENDA_EDIT_B", "AGENDA_EDIT_C","AGENDA_EDIT_D","AGENDA_EDIT_E"



               //folder 4 AGENDA_EDIT_D
REDEFINE GET oDat[19] VAR aDat[19] ID 100 OF oFld:aDialogs[4] PICTURE "@!"   UPDATE

         oDat[20] := TImage():ReDefine( 101,, aDat[19], oFld:aDialogs[4],,, .F., .T.,,, .F.,, )

       REDEFINE BTNBMP ID 102 OF oFld:aDialogs[4] RESOURCE "b_chg" NOBORDER;
                  TOOLTIP "Seleziona" ;
                  ACTION (oDat[20]:LoadImage( , cFile1 := cGetFile32( "Immagini (*.jpg)| *.jpg|","Seleziona immagine",,".\Images\" )),;
                  oDat[20]:Refresh(),aDat[19]:= cFile1, oDat[19]:Refresh() )

       REDEFINE BTNBMP ID 103 OF oFld:aDialogs[4] RESOURCE "B_PRV" NOBORDER;
                  TOOLTIP "Zoom"
       *action zoomimage(aDat[19])


 ACTIVATE DIALOG oDlg CENTERED

return nil

Posted: Wed Jan 17, 2007 7:01 pm
by Antonio Linares
Silvio,

Please call INITCOMMONCONTROLS() before DEFINE DIALOG ...

Posted: Wed Jan 17, 2007 11:47 pm
by Silvio
Application
===========
Path and name: C:\work\errori\fsdi2006\prg\testgar.Exe (32 bits)
Size: 438,272 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 01/18/07, 00:45:02
Error description: Error BASE/1004 Class: 'NIL' has no exported method: ADIALOGS
Args:


I tried to compile with PellesC but it make the same error

Posted: Wed Jan 17, 2007 11:57 pm
by Silvio
when I erase folder control ....

it run ok

Posted: Thu Jan 18, 2007 2:19 am
by jose_murugosa
Silvio,

I see oFld variable defined as local at the start of the function but you didn´t store the folder object in it :roll:

DEFINE FOLDER oFld ID .... OF ......

I think that´s the problem.

Posted: Thu Jan 18, 2007 8:23 am
by Silvio
I tried and now run ok

there is an error on dialog AGENDA_EDIT_D
when I erase all control on it the dialog and folder run ok

the dialog AGENDA_edit_d have :

Code: Select all

AGENDA_EDIT_D DIALOG 29, 69, 312, 122 
STYLE WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN 
FONT 8, "MS Sans Serif" 
{ 
 CONTROL "", 101, "TImage", 0 | WS_CHILD | WS_VISIBLE, 218, 18, 73, 86 
 CONTROL "TBtnBmp", 103, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE, 180, 26, 12, 12 
 CONTROL "TBtnBmp", 102, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE, 164, 26, 12, 12 
 EDITTEXT 100, 6, 10, 187, 12 
 GROUPBOX "", 501, 202, 7, 103, 111, BS_GROUPBOX 
 LTEXT "Taglia : ", -1, 27, 40, 35, 8 
 CONTROL "S", 104, "BUTTON", BS_AUTORADIOBUTTON, 71, 43, 60, 12 
 CONTROL "M", 105, "BUTTON", BS_AUTORADIOBUTTON, 71, 56, 60, 12 
 CONTROL "L", 106, "BUTTON", BS_AUTORADIOBUTTON, 71, 69, 60, 12 
 CONTROL "XL", 107, "BUTTON", BS_AUTORADIOBUTTON, 132, 43, 60, 12 
 CONTROL "XXL", 108, "BUTTON", BS_AUTORADIOBUTTON, 132, 56, 60, 12 
 CONTROL "XXXL", 109, "BUTTON", BS_AUTORADIOBUTTON, 132, 69, 60, 12 
 LTEXT "Quota associativa : ", -1, 6, 86, 60, 8 
 EDITTEXT 110, 70, 84, 53, 12 
 LTEXT "Versato anno corrente :", -1, 6, 106, 80, 8 
 CONTROL "Si", 111, "BUTTON", BS_AUTORADIOBUTTON, 93, 105, 23, 12 
 CONTROL "No", 112, "BUTTON", BS_AUTORADIOBUTTON, 124, 106, 23, 12 
} 


there is something not run ok but wich ?
I not found anything
I copied it from another my program ( on old program 32 bit run ok)