Member Variable in Property Page
It seems like it is not possible to access member variable from a property page as described below.
I have a sheet holder and two property page which are page1 and page2
From page 1, I went to the class wizard and created a member variable named m_Edit which is type of control.
Now, from the main page, the page that hold property sheet 1 and 2 I went to the OnInitDialog and do something like that
m_Edit.SetWindowText("Some Text);//not working
however, if I do something like that it works fine
CEdit* pEdit;
pEdit = (CEdit*)Page1->GetDlgItem(IDC_EDIT1);
pEdit->SetWindowText("Some Text");
I wonder if there is a possibility where I can make the first case work. It will take me time if I can't, because I do have a dialog with a lot of control on it, I would like to change it to property page in order to make it user friendly. It would have been easier for me if I can drage these control and put them to different seet without any change. For the second case, I have to make a lot of changes.
[1084 byte] By [
vcstarter] at [2007-11-18 17:41:30]

# 2 Re: Member Variable in Property Page
I am calling it inside the OnInitDialog, after all my property page initialization. The reason is not working, because the control is not in the main page(the page holder), it is on page one.
# 3 Re: Member Variable in Property Page
Originally posted by vcstarter
I am calling it inside the OnInitDialog, after all my property page initialization. The reason is not working, because the control is not in the main page(the page holder), it is on page one.
Please be specific when you say not working. Nothing happens, doesn't compile, generates an assert, crashes all point to different problems. Remember we are not mind readers here.
If the control is on a page and not the sheet can you set its value in the page's OnInitDialog? I take it that is isn't compiling because m_Edit isn't a member of the sheet. If that's the case just call m_Page1.m_Edit.SetWindowText, or whatever is appropriate in your case.
GCDEF at 2007-11-11 1:28:13 >
