Microsoft KB Archive/234664

= BUG: Containers Show  Menu Items for OCX Linked to MFC Static Library =

Article ID: 234664

Article Last Modified on 9/12/2003

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Standard Edition

 Microsoft Visual C++ .NET 2002 Standard Edition</li></ul>

 Microsoft Visual C++ .NET 2003 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q234664

<div class="symptoms_section">

SYMPTOMS
When an ActiveX control linked to an MFC static library is placed in a test container, the Edit/ActiveX control object menu item shows menu items instead of names of verbs available on the object, such as edit & properties.

When the same control is placed on a dialog in Visual C++ resource editor, the context menu shows menu items under ActiveXcontrol object sub menu.

When the same control is placed on a Visual Basic form, the context menu shows menu items.

<div class="cause_section">

CAUSE
String resources for these verbs are defined in Afxctl.rc. This file is not included in an ActiveX control project by default. When project settings are changed to link to MFC static library, this file should be included in the project by Visual C++ IDE.

<div class="resolution_section">

RESOLUTION

 * Open an ActiveX control project in IDE.
 * Select the view/resource includes menu item.
 * Add #include <afxctl.rc> statement in compile-time directives list.
 * Ignore the warning you receive when you click OK.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce Behavior

 * 1) Create an ActiveX control project using AppWizard and selecting Available in Insert Object dialog in step 2.
 * 2) Select Project/Settings.
 * 3) Change Use MFC in shared DLL to Use MFC in static library.
 * 4) Insert the control in the test container.
 * 5) Select Edit/ActiveX control object to see entries.

Keywords: kbbug kbcontainer kbctrlcreate KB234664

-

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

© Microsoft Corporation. All rights reserved.