Hi every one,i'm following this tutorial and i can't seem to find the Message Maps property sheet in Visual Studio 2008.

This is the link of the Tutorial

http://www.functionx.com/visualc/dialog/dialog2.htm

In the 27nth step says : Click the Message Maps property sheet
but i don't find it in VC2008

I will appreciate if some one tells me where that option is.

Dani AI

Generated

That FunctionX tutorial is showing the old VC++ ClassWizard UI (pre-.NET). Visual Studio 2008 does not expose a separate "Message Maps" property sheet the same way VC6 did. The message-map / handler editing is built into the Resource Editor and ClassView — you will use "Add Event Handler..." (or edit the message-map macros directly) instead of a standalone "Message Maps" tab.

Typical steps in VS2008 to add a handler (Resource Editor):

  • Open Resource View (View -> Other Windows -> Resource View).
  • Double-click the dialog to open it in the resource editor.
  • Select the control (or click the dialog background), right-click and choose "Add Event Handler...".
  • In the dialog pick the target class and the message (e.g., BN_CLICKED) and click Add. VS will insert the afx_msg declaration and the appropriate ON_... entry inside BEGIN_MESSAGE_MAP / END_MESSAGE_MAP.

If you prefer to do it by hand, add the declaration to the header and the map entry in the .cpp. For example:

// in MyDialog.h
class CMyDialog : public CDialog
{
protected:
    afx_msg void OnMyButton();
    DECLARE_MESSAGE_MAP()
};

// in MyDialog.cpp
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
    ON_BN_CLICKED(IDC_MYBUTTON, &CMyDialog::OnMyButton)
END_MESSAGE_MAP()

void CMyDialog::OnMyButton()
{
    // handler code
}

Troubleshooting: as hinted, Express editions lack MFC support; if "Add Event Handler..." is missing make sure the project is an MFC project (created to use MFC) and that MFC support is installed. Thanks to for the MSDN pointer — the documentation explains how the editor and ClassView handle message handlers in VS2008.

Recommended Answers

All 7 Replies

Perhaps it is an option only available in the Pro version and you have the Express version?

I have Visual Studio Pro

Well if you have VS 2008 Pro then you have a very complete MSDN help installed ;)...
Continue?...

Yes,Continue.

Yes,Continue.

Alas, I have VS 2008 Express only. No MFC stuff in this edition ;)...

MSDN Doesn't tell anything about Message Maps property sheet.

May be it helps:

>MSDN Doesn't tell anything about Message Maps property sheet
But there are some articles about Message Map in VS 2008 there ;)
For example:
http://msdn.microsoft.com/ru-ru/visualc/cc948991(en-us).aspx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.