-
December 18th, 2007, 07:35 AM
#1
"Object required" (When add variable)
Hi,
In VC++ 2005, when I add a variable to a dialog (m_slider for a slider control in that dialog), the class wizard always returned me "Object required", without any other informations.
Could anyone please help me for this problem? It's driving me nut!
Thanks in advanced.
-
December 18th, 2007, 12:41 PM
#2
Re: "Object required" (When add variable)
Originally Posted by hoainam85
Hi,
In VC++ 2005, when I add a variable to a dialog (m_slider for a slider control in that dialog), the class wizard always returned me "Object required", without any other informations.
Could anyone please help me for this problem? It's driving me nut!
Thanks in advanced.
So you may prefer to assing a variable by writing a line, like that:
Code:
CSliderCtrl* pSlider = (CSliderCtrl*) GetDlgItem(IDC_SLIDER1);
-
December 18th, 2007, 03:34 PM
#3
Re: "Object required" (When add variable)
-
December 18th, 2007, 04:02 PM
#4
Re: "Object required" (When add variable)
Originally Posted by hoainam85
Hi,
In VC++ 2005, when I add a variable to a dialog (m_slider for a slider control in that dialog), the class wizard always returned me "Object required", without any other informations.
Could anyone please help me for this problem? It's driving me nut!
Thanks in advanced.
When you add the variable, do you have the control highlighted when you click on the 'Add variable...' menu item?
-
December 18th, 2007, 05:08 PM
#5
Re: "Object required" (When add variable)
You can also add a CSliderCtrl member variable manually to the class, and then in DoDataExchange add this:
Code:
void CYourDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_SLIDER_ID, &m_slider);
}
That's exactly what VS is doing for you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|