CPropertyPage problems continue...
-
How can I use the hWnd of a property page? I created a CPropertyPage object in a thread (using new) and then used PostMessage() in order to call AddPage(CPropertyPage) from the main app thread. But then, I couldn't make any use of hWnd of that CPropertyPage,IsWindow(CPropertyPage->m_hWnd) returns false. PostMessage(msg,CPropertyPage->m_hWnd) and even CPropertyPage->UpdateData() fails (debug assertions). I need to use it this way, because I just wanted to have a set of dialogs groupped in property pages. I need to access the hWnd to use with PostMessage and WSAASyncSelect (as it will receive network notification) How can I do that? Maybe I am doing something wrong ? :eek: thanks for any help
-
How can I use the hWnd of a property page? I created a CPropertyPage object in a thread (using new) and then used PostMessage() in order to call AddPage(CPropertyPage) from the main app thread. But then, I couldn't make any use of hWnd of that CPropertyPage,IsWindow(CPropertyPage->m_hWnd) returns false. PostMessage(msg,CPropertyPage->m_hWnd) and even CPropertyPage->UpdateData() fails (debug assertions). I need to use it this way, because I just wanted to have a set of dialogs groupped in property pages. I need to access the hWnd to use with PostMessage and WSAASyncSelect (as it will receive network notification) How can I do that? Maybe I am doing something wrong ? :eek: thanks for any help
-
OK I know why it happens... it's because MFC postpones creation of a window until it's tab is selected by a user... Is there any possiblity to overcome that ie. to force mfc to create that window earlier and not wait for user selection ?
lookig into source i see something like this used in another case but maybe it is what you need t! BOOL bResult = CPropertySheet::OnInitDialog(); int ActPage = GetActiveIndex(); for(int i = 0; i < GetPageCount(); i++) SetActivePage(i); SetActivePage(ActPage); //return back
-
lookig into source i see something like this used in another case but maybe it is what you need t! BOOL bResult = CPropertySheet::OnInitDialog(); int ActPage = GetActiveIndex(); for(int i = 0; i < GetPageCount(); i++) SetActivePage(i); SetActivePage(ActPage); //return back
This should work, but I'm afraid that the swap of active pages will be visible to the user (as this has to take place during runtime, and I think this code was used before the creation of CPropertySheet). Why did they prevent that stupid window from creating during AddPage ? anyway thank you, I will be trying...