CPropertySheet embedded in CDialog, Please answer with EMail 
Author Message
 CPropertySheet embedded in CDialog, Please answer with EMail

Using VC 4.2b2, on Intel, Win95 (repost, did not get any reply)

I am having troubles using a CPropertySheet which is created as a child in
a dialog (embedded in a dialog, just like the tabbed ctrl, but with real
property pages, so that I do not have to show/hide/load all the property
page's controls manually)

I can create and position the property sheet all right, every thing just
works fine...with one little exception:

!  Always when I create a messagebox from within my property page, it will
lock up my program.
! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I then can break my using MSDEV's break, and find myself sowhere in the
middle of MFC...but cannot figure out what's happening...my programm
doesn't even get WM_PAINTs (or anything) anymore (of course before I
break).

What's the deal ? Anyone can help ? Book's online say something like "You
can place property sheets inside a dialog, but you must give the parent the
WS_EX_CONTROLPARENT style and call IsDialogMessage. I tried everything, but
it doesn' t work.

Any ideas ???

-----snip-----snip-----snip-----snip-----snip-----snip-----snip-----snip

Here is how I create it:

IDC_FRAME is an invisible rectangle create with the dialog editior, it is
just a helper to position the property sheet visually...

BOOL CPreviewDlg::OnInitDialog()
{
        CWnd *pWnd = GetDlgItem(IDC_FRAME);     // PropertySheet must have this size
        if (pWnd) {
                pWnd->ShowWindow(SW_HIDE);   // we dont want to see the frame
                CRect rect;
                pWnd->GetWindowRect(rect);           // get frame's cords

                pPage1 = new CPageOne(  );              // construct them pages...
                m_PropertySheet.AddPage(pPage1);
                pPage2 = new CPageTwo(  );
                m_PropertySheet.AddPage(pPage2);
                pPage3->m_pTree = &m_Tree1;
                m_PropertySheet.AddPage(pPage3);

                m_PropertySheet.m_Parent = this;
                m_PropertySheet.Construct( "Hi", this, 0);
                m_PropertySheet.Create( this, WS_CHILD | WS_VISIBLE, WS_EX_CLIENTEDGE );

......



Fri, 24 Sep 1999 03:00:00 GMT  
 CPropertySheet embedded in CDialog, Please answer with EMail

This is known bug with Windows NT 4.0. Check out article Q149501 in
Microsoft's Knowledge Base. Here is their suggested solution:

BOOL CMySheet::OnInitDialog()
{
        ModifyStyleEx(0, WS_EX_CONTROLPARENT);
        return CPropertySheet::OnInitDialog();

Quote:
}

The program hangs because the child CPropertySheet continuously receives a
WM_GETDLGCODE message.

Nathan



Quote:
> Using VC 4.2b2, on Intel, Win95 (repost, did not get any reply)

> I am having troubles using a CPropertySheet which is created as a child
in
> a dialog (embedded in a dialog, just like the tabbed ctrl, but with real
> property pages, so that I do not have to show/hide/load all the property
> page's controls manually)

> I can create and position the property sheet all right, every thing just
> works fine...with one little exception:

> !  Always when I create a messagebox from within my property page, it
will
> lock up my program.
> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
> - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - -

> I then can break my using MSDEV's break, and find myself sowhere in the
> middle of MFC...but cannot figure out what's happening...my programm
> doesn't even get WM_PAINTs (or anything) anymore (of course before I
> break).

> What's the deal ? Anyone can help ? Book's online say something like "You
> can place property sheets inside a dialog, but you must give the parent
the
> WS_EX_CONTROLPARENT style and call IsDialogMessage. I tried everything,
but
> it doesn' t work.

> Any ideas ???

> -----snip-----snip-----snip-----snip-----snip-----snip-----snip-----snip

> Here is how I create it:

> IDC_FRAME is an invisible rectangle create with the dialog editior, it is
> just a helper to position the property sheet visually...

> BOOL CPreviewDlg::OnInitDialog()
> {
>    CWnd *pWnd = GetDlgItem(IDC_FRAME);     // PropertySheet must have this size
>    if (pWnd) {
>            pWnd->ShowWindow(SW_HIDE);   // we dont want to see the frame
>            CRect rect;
>            pWnd->GetWindowRect(rect);           // get frame's cords

>            pPage1 = new CPageOne(  );              // construct them pages...
>            m_PropertySheet.AddPage(pPage1);
>            pPage2 = new CPageTwo(  );
>            m_PropertySheet.AddPage(pPage2);
>            pPage3->m_pTree = &m_Tree1;
>            m_PropertySheet.AddPage(pPage3);

>            m_PropertySheet.m_Parent = this;
>            m_PropertySheet.Construct( "Hi", this, 0);
>            m_PropertySheet.Create( this, WS_CHILD | WS_VISIBLE, WS_EX_CLIENTEDGE
);

> ......



Fri, 24 Sep 1999 03:00:00 GMT  
 CPropertySheet embedded in CDialog, Please answer with EMail

I. You might try looking just above the break within the MFC code.
Sometimes their are juicy little statements about why you entered that
particular section of code.

II. Are you trying to bring up a simple AfxMessageBox or your own CDialog
derivative message box?  I you are creating your own message box using a
CDialog, you cannot use "Extended Styles" on any of the control that are
within a CPropertyPage.  CPropertyPage does not support extended styles at
this time.

Hope that helps.

--
John Urban
WorldCom



Fri, 24 Sep 1999 03:00:00 GMT  
 CPropertySheet embedded in CDialog, Please answer with EMail

Uh...the bug (according to MS) is against MFC V4.0, NOT NT V4.0!


Quote:

>This is known bug with Windows NT 4.0. Check out article Q149501 in
>Microsoft's Knowledge Base. Here is their suggested solution:

>BOOL CMySheet::OnInitDialog()
>{
>        ModifyStyleEx(0, WS_EX_CONTROLPARENT);
>        return CPropertySheet::OnInitDialog();
>}

>The program hangs because the child CPropertySheet continuously receives a
>WM_GETDLGCODE message.

>Nathan



>> Using VC 4.2b2, on Intel, Win95 (repost, did not get any reply)

>> I am having troubles using a CPropertySheet which is created as a child
>in
>> a dialog (embedded in a dialog, just like the tabbed ctrl, but with real
>> property pages, so that I do not have to show/hide/load all the property
>> page's controls manually)

>> I can create and position the property sheet all right, every thing just
>> works fine...with one little exception:

>> !  Always when I create a messagebox from within my property page, it
>will
>> lock up my program.
>> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>-
>> - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - -

>> I then can break my using MSDEV's break, and find myself sowhere in the
>> middle of MFC...but cannot figure out what's happening...my programm
>> doesn't even get WM_PAINTs (or anything) anymore (of course before I
>> break).

>> What's the deal ? Anyone can help ? Book's online say something like "You
>> can place property sheets inside a dialog, but you must give the parent
>the
>> WS_EX_CONTROLPARENT style and call IsDialogMessage. I tried everything,
>but
>> it doesn' t work.

>> Any ideas ???

>> -----snip-----snip-----snip-----snip-----snip-----snip-----snip-----snip

>> Here is how I create it:

>> IDC_FRAME is an invisible rectangle create with the dialog editior, it is
>> just a helper to position the property sheet visually...

>> BOOL CPreviewDlg::OnInitDialog()
>> {
>>       CWnd *pWnd = GetDlgItem(IDC_FRAME);     // PropertySheet must have this
> size
>>       if (pWnd) {
>>               pWnd->ShowWindow(SW_HIDE);      // we dont want to see the
> frame
>>               CRect rect;
>>               pWnd->GetWindowRect(rect);              // get frame's cords

>>               pPage1 = new CPageOne(  );              // construct them
> pages...
>>               m_PropertySheet.AddPage(pPage1);
>>               pPage2 = new CPageTwo(  );
>>               m_PropertySheet.AddPage(pPage2);
>>               pPage3->m_pTree = &m_Tree1;
>>               m_PropertySheet.AddPage(pPage3);

>>               m_PropertySheet.m_Parent = this;
>>               m_PropertySheet.Construct( "Hi", this, 0);
>>               m_PropertySheet.Create( this, WS_CHILD | WS_VISIBLE,
> WS_EX_CLIENTEDGE
>);

>> ......

--------------------------------------------------------------------------------


XIOtech Corporation               Personal Home Page:   http://www.visi.com/~nde
Eden Prairie, MN

"Question authority...and the authorities will end up questioning YOU!"
--------------------------------------------------------------------------------



Sat, 25 Sep 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Embed picture in HTML email

2. Embed image in Email

3. PLS Email me answer

4. CDialog, cpropertysheet and CTreeCtrl

5. Focus problem with CPropertySheet as control in CDialog

6. PLEASE REPLY: Doing a statistics project, PLEASE ANSWER

7. Embed modeless CPropertySheet object in a view

8. Crash when using embedded CPropertySheet (focus issue).

9. Embedding: CPropertySheet in CPropertyPage

10. Embedded CPropertySheet - CTabCtrl doesn't reflect EnableWindow(FALSE)

11. Embedded CPropertySheet and tab order

12. Changing Tab Order of Embedded CPropertySheet

 

 
Powered by phpBB® Forum Software