Click to See Complete Forum and Search --> : Messaging between CPropertySheet and CPropertyPage


DanielF
April 16th, 1999, 10:03 AM
Hi All,

It seems I must be missing something fundimental.

Generally: How to get a class to handle an event that originates in one of its members?

Specifically: I've got a CPropertySheet that has several CPropertyPage's. One of the CPropertyPage's has a button, but I need the BN_CLICKED message to be handled by the CPropertySheet.

Any help would me most appreciated.

Thanks in advance
Daniel

Douglas Peterson
April 16th, 1999, 11:10 AM
There are several ways you could do this:

1) Have the property sheet object give the page object a pointer to itself and then the page can callback some special method of the sheet.

2) From the page's handler of the BN_CLICKED notification you could resend the notification to the page's parent window (the sheet):
GetParent()->SendMessage(WM_COMMAND, MAKEWPARAM(BN_CLICKED, buttonID), (LPARAM)GetDlgItem(buttonID)->m_hWnd);