cant add any variable on main CDialog but all other

Hi,

I'm a french developper so sorry for my english's mistakes... :)

I'm looking why I can't add any variable on main CDialog in a DialogBox project,

when I right click on my main CDialog, "Add Variable" is disabled but when I try on any other CDialog I use by "DoModal", "Add Variable" is able and I can use it normaly.

I didn't do anything differently between any CDialog (I think, else it wasn't wanted)

Could you help me correcting that ?

Real thanks.

FireJocker.
[562 byte] By [FireJocker] at [2007-11-19 18:05:22]
# 1 Re: cant add any variable on main CDialog but all other
The problems could be:

1. You Did not add a class for that dialog.

2. You add a class for that dialog but after that you changed the dialog ID ex: at the filrst time you had IDD_DIALOG1 you changed to IDD_OTHERDIALOG
(the solution would be that change in the dialogs heder file the enum{IDD=IDD_OTHERDIALOG};

If this not helps then please post more information.
g_gili at 2007-11-10 23:47:46 >
# 2 Re: cant add any variable on main CDialog but all other
Yes !!!

you're right !

With the 2nd solution ! it was my mistake !!!!

I discovered Visual C++ a few month ago, so I tryed many things and I 've changed

enum { IDD = IDD_DlAccueil };

by

enum { IDD = IDD_APPS_DIALOG };

Correcting that corrects my problem ! real thanks !!!

the more strange is that in Ressource.h, both of them were defined to 102

#define IDD_APPS_DIALOG 102
#define IDD_DlAccueil 102

So why does it make trouble ?
FireJocker at 2007-11-10 23:48:54 >
# 3 Re: cant add any variable on main CDialog but all other
Yes !!!

you're right !

With the 2nd solution ! it was my mistake !!!!

I discovered Visual C++ a few month ago, so I tryed many things and I 've changed

enum { IDD = IDD_DlAccueil };

by

enum { IDD = IDD_APPS_DIALOG };

Correcting that corrects my problem ! real thanks !!!

Your welcome. :)


the more strange is that in Ressource.h, both of them were defined to 102

#define IDD_APPS_DIALOG 102
#define IDD_DlAccueil 102

So why does it make trouble ?
You changed the name, but if you look in a text editor your *.rc file then you realize that your dialog ID it's updated. Just a simple sample.

IDD_WEEKATAGLANCE DIALOGEX 0, 0, 392, 367
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SINGLESEL |
LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,69,378,127
PUSHBUTTON "Done",IDC_DONE,334,345,50,14
EDITTEXT IDC_EDIT1,81,214,226,11,ES_AUTOHSCROLL | ES_READONLY
EDITTEXT IDC_EDIT2,81,231,226,11,ES_AUTOHSCROLL | ES_READONLY
END

Well it's not a problem. Did you rebuild the hole project. Then it will be removed.
g_gili at 2007-11-10 23:49:47 >
# 4 Re: cant add any variable on main CDialog but all other
Yes I rebuilt it many time but it didn't changed.

bah, it's not important if it works :)
FireJocker at 2007-11-10 23:50:53 >
# 5 Re: cant add any variable on main CDialog but all other
Then you can remove that duplicate if you want but I recomend to leave it how it is.
g_gili at 2007-11-10 23:51:57 >
# 6 Re: cant add any variable on main CDialog but all other
Ok, thanks (I won't modify it :) )
FireJocker at 2007-11-10 23:52:56 >