huya
asked on
Dialog title
How do I change the title of a dialog??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No, call SetWindowText for your dialog, not for control. It will set dialog title
ASKER
I have tried that... and at the point where I go to change the
title, the program crashes :
Sample code :
CDoorDescript doordescriptdlg(pDoc, &rearstruct, false);
doordescriptdlg.SetWindowT ext(CStrin g("Hello") );
doordescriptdlg.DoModal();
title, the program crashes :
Sample code :
CDoorDescript doordescriptdlg(pDoc, &rearstruct, false);
doordescriptdlg.SetWindowT
doordescriptdlg.DoModal();
Your mistake is that you call SetWindowText BEFORe dialog is created so you program crahes. You must call this function from inside your dialog OnInitDialog.
ASKER
Thanks
GetDlgItem(IDD_DIALOG_IDEN
SetWindowText is a member function of class CWnd and can be used on any object, including dialogs (class CDialog) derived from CWnd.