Microsoft KB Archive/117378

= INFO: Command IDs and In-Place Frame Window Toolbar =

Article ID: 117378

Article Last Modified on 12/2/2003

-

APPLIES TO

 The AppWizard, when used with:  Microsoft Visual C++ 1.5 Professional Edition

 Microsoft Visual C++ 1.51

 Microsoft Visual C++ 1.52 Professional Edition

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

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

-

<div class="notice_section">

This article was previously published under Q117378

<div class="summary_section">

SUMMARY
AppWizard generates code that uses a static UINT array called "buttons" to associate command IDs to a single toolbar bitmap that contains several images for buttons 16 pixels wide and 15 pixels high. The IDs are associated with the toolbar buttons, based on their order in the array.

When you construct a full-server or mini-server OLE application using AppWizard and you have not selected context-sensitive Help support, the "buttons" array used by the application's in-place frame window class will contain one less command ID than the toolbar contains buttons. This behavior is by design. The image for the Help mode button is included in the toolbar bitmap, even when the application is generated without context- sensitive Help support.

<div class="moreinformation_section">

MORE INFORMATION
To view this behavior, perform the following steps:
 * 1) Start AppWizard and choose full-server or mini-server for the application by selecting OLE Options from the main AppWizard dialog box.
 * 2) Have AppWizard create the application.
 * 3) Open App Studio, and, if you have a full-server application, open the bitmap with the ID "IDR_xxxxxxTYPE_SRVR_IP", where xxxxxx is the first six letters of your project. For example, if the project is named "EXAMPLE", the bitmap would be "IDR_EXAMPLTYPE_SRVR_IP". If you have a mini-server application, the bitmap would have the ID "IDR_SRVR_INPLACE".
 * 4) Open the file IPFRAME.CPP in Visual C++. Find the variable named "buttons". Count how many IDs are there besides the ID_SEPARATOR IDs. This would normally be equal to the number of button images that appear on the toolbar bitmap, but in this situation they are not equal.
 * 5) Now count how many button images are in the bitmap. There will be one more image than there are IDs (not including ID_SEPARATOR IDs). In a default application created by AppWizard, there will be four IDs and five button images.

You need to be aware of this behavior if you decide to add buttons to the toolbar for the in-place frame window class. If the application does not support context-sensitive Help or the Help mode button, the button image could simply be replaced with the new button. If context-sensitive Help will be part of the application, then you need to make sure the command IDs that you add correspond to the correct button image. Otherwise, the buttons will not operate the way you expect them to operate.

Keywords: kbwizard KB117378

-

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

© Microsoft Corporation. All rights reserved.