
Setting Text of Edit Control in Dialog Box of Control Panel Applet
I've written a Control Panel Applet including just one dialog box. The
dialog box class has been derived from CDialog and there are several
controls on it, one of which is a edit control. I want to set the text of
this control. So I've done something like:
CWnd* intervalLengthLabel;
intervalLengthLabel = GetDlgItem(IDC_INTERVAL_LENGTH);
if (intervalLengthLabel != NULL)
{ //OK
intervalLengthLabel->SetWindowText("just some text");
Quote:
}
else
{ //error
AfxMessageBox("Not been able to get EditBox handle");
Quote:
}
Well, I've used this on several other projects (dialog based applications),
no prob. But on this project, it just doesn't return the handle. The error
doesn't fall under the category 'misspelled'. I also tried to use it that
way GetDlgItem(IDC_INTERVAL_LENGTH, intervalLengthLabel); - well, it didn't
work either. The compiler actually didn't know this function though it is in
the MSDN documentation. I don't see any difference between the two projects
(besides one is a dialog based application and the other is a dll used as
cpl) so I don't know what's going wrong... Any suggestions? Thanks for any
help
cheers, thomas
----------------------------------------------------------------------
my eMail address has been modified
I think you can guess what should be removed...