Microsoft KB Archive/98198

= INFO: CDialogBar Button Enabled When Command Handler Present =

Article ID: 98198

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 1.0 Professional Edition

 Microsoft Visual C++ 1.5 Professional Edition

 Microsoft Visual C++ 1.51

 Microsoft Visual C++ 1.52 Professional Edition</li></ul>

 Microsoft Visual C++ 1.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.1</li></ul>

 Microsoft Visual C++ 4.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q98198

<div class="notice_section">

<div class="notice_section">

A button in a CDialogBar object is disabled automatically if the command routing does not contain a command handler function for the button.

To enable a button in a CDialogBar object, the command routing must include a command handler for the button. A button command handler can be an ON_BN_CLICKED, ON_COMMAND, or ON_COMMAND_UI message handler and it must appear in the message map of an object in the command routing. If the parent of the CDialogBar object is a CFrameWnd object, then the command is handled by the active child window or view, by the document attached to the view, by the frame window, and by the application (CWinApp object).

NOTE: Because the CDialogBar object is not included in the routing scheme, the ON_BN_CLICKED or ON_COMMAND handler must be placed in one of the objects mentioned above that is in the routing scheme and not in the CDialogBar class.

For more information on command routing, see the &quot;Command Routing&quot; section in Chapter 3 of the &quot;Class Library Reference&quot; manual. In Visual C++ 32-bit Edition, version 4.0, see both the &quot;Command Routing&quot; topic of the &quot;Programming with MFC: Overview&quot; in the Books Online and the MFC Technical Note 31, Control Bars.

<div class="summary_section">

SUMMARY
Additional query words: 1.00 1.50 2.00 2.10 2.50 2.51 2.52 3.00 3.10 4.00 enabling disabling kbinf

Keywords: kbinfo kbarchitecture kbdlg kbmfcctrlbar KB98198

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.