Microsoft KB Archive/185695

= HOWTO: Renaming an ActiveX Control After its Project Is Created =

Article ID: 185695

Article Last Modified on 11/21/2006

-

APPLIES TO

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

 Microsoft Visual C++ 5.0 Professional Edition

 Microsoft Visual C++ 6.0 Enterprise Edition

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

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

-

<div class="notice_section">

This article was previously published under Q185695

<div class="summary_section">

SUMMARY
If you use ControlWizard to generate an MFC ActiveX control, the registered name of the control is usually the same as its project name. For instance, if the control's project name is "BABY," then the ActiveX control is named as "BABY Control" in the Insert ActiveX Control dialog box of any Visual C++ application.

However, Visual Basic shows the control's module name instead in its Components dialog box.

This article shows you a way to change the control's registered name and module name after the control's project has been created.

<div class="moreinformation_section">

MORE INFORMATION
The registered name may be found from a string resource in the .rc file of the control's project. The string resource always starts with IDS_XXX where XXX is the name of the control's project. If the project name is "BABY," then the following can be found in the string's table of the control's project: <pre class="fixed_text">  IDS_BABY               "BABY Control" Set a new control name to the IDS_XXX string resource and rebuild the control's project. The control is shown in its new name in the Insert ActiveX Control dialog box.

The control's module name is defined at the first helpstring in the .odl file of the control's project file. The following is found from the .odl file of the BABY's project: <pre class="fixed_text">  helpstring("BABY ActiveX Control module") Set a new module name to the helpstring above and rebuild the control's project. The control's new module name is shown in Visual Basic's Components dialog box.

(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Yeong- Kah Tam, Microsoft Corporation.

Keywords: kbctrl kbhowto kbwizard KB185695

-

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

© Microsoft Corporation. All rights reserved.