|
-
April 22nd, 2002, 10:14 AM
#1
How to enable buttons in my view ?
Hi everybody,
Here a strange problem for me.
In the OnInitialUpdate of my CView class, I disable buttons and control lists because no data is loaded.
When the user opens a file, in my CMyDoc::Serialize function, I tell my view to enable buttons. But it doesn't work. Look at this code.
void CMyDoc::Serialize(...)
{
if(!ar.IsStoring())
{
...
POSITION pos = GetFirstViewPosition();
CMyView* pView = (CMyView*) GetNextView(pos);
pView->EnableTheControls();
}
}
...
void CMyView::EnableTheControls()
{
CButton* pButton = (CButton*) GetDlgItem(IDC_BUTTON);
pButton->EnableWindow(TRUE);
}
The code below doesn't work, the controls are still disable. Can someone tell me why ? I try the UpdateWindow() function also in the CMyView function but I don't get anything more. Please help !
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
|