HOWTO: Renaming an ActiveX Control After its Project Is Created

ID: Q185695


The information in this article applies to:
  • The Microsoft Foundation Classes (MFC), included with:
    • Microsoft Visual C++, 32-bit Editions, versions 5.0, 6.0


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.


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:


   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:

   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.

Additional query words:

Keywords : kbole kbwizard kbMFC kbVC kbVC500 kbVC600
Version : WINNT:5.0,6.0
Platform : winnt
Issue type : kbhowto


Last Reviewed: July 28, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.