Enabling a menuitem that connect to a modelless property she
Yoong Hor Meng -- eng30391@leonis.nus.sg
Wednesday, November 20, 1996
Environment: VC++ 1.52 Windows 3.1
Hi:
I am developing a software package that require property sheet. I
have create derived classes from CPropertyPage and CPropertySheet and
store them together in a file. I have also created the menuitem in the
menu resource.
Now I want to enable to menuitem but I want all the implementation
to be in the file mentioned above. In other words, I don't want
CWndFrame, CDocument, CView to handle it. I want OOP.
Could you give me some guidelines? Thank you.
Michael S. Scherotter -- mss@tartus.com
Friday, November 22, 1996
Yoong Hor Meng wrote:
>
> Environment: VC++ 1.52 Windows 3.1
>
> Hi:
> I am developing a software package that require property sheet. I
> have create derived classes from CPropertyPage and CPropertySheet and
> store them together in a file. I have also created the menuitem in the
> menu resource.
> Now I want to enable to menuitem but I want all the implementation
> to be in the file mentioned above. In other words, I don't want
> CWndFrame, CDocument, CView to handle it. I want OOP.
>
> Could you give me some guidelines? Thank you.
Implement this function in your view class (if that has the pointer to the
property sheet.
This send the message to the property sheet's message map.
BOOL CMyView::OnCmdMsg(UINT nID, int nCode, void* pExtra,
AFX_CMDHANDLERINFO* pHandlerInfo)
{
if ((m_pPropertySheet
&& m_pPropertySheet->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
{
return TRUE;
}
return CView::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
--
Michael S. Scherotter |Architectural Design Tools
Lead Software Developer |AutoCAD Applications
Tartus Development, Inc. |Custom CAD Solutions
630 Las Gallinas Ave #300 |__________________________
San Rafael, CA 94903 mss@tartus.com
(415) 491-8925 michael@charette.com
(415) 491-8921 (fax) 71035.1675@compuserve.com
http://www.tartus.com/people/mss
____________________________________________________________
| Вернуться в корень Архива
|