PRB: Visual Basic Replaces Missing Controls with PictureBoxesLast reviewed: April 30, 1997Article ID: Q167707 |
The information in this article applies to:
SYMPTOMSIf a Visual Basic project uses a custom control (.OCX) whose CLSID has changed since the project was last opened, the following message will be displayed when opening the project:
'<Path To OCX>' could not be loaded-Continue Loading Project?After choosing "Yes," a second message will occur two times:
"Errors during load. Refer to <Path To LOG File> for details"Once the project is opened, all occurrences of the custom control have been replaced with PictureBox controls.
CAUSEWhen Visual Basic attempts to load a custom control, each control is verified by its CLSID. If the CLSID stored with the project differs from the CLSID of the custom control, Visual Basic cannot load the control. In an attempt to maintain as many properties as possible, Visual Basic replaces the missing control with a PictureBox control. The code associated with the missing control is retained. A CLSID of a custom control changes when any of the following conditions are true:
RESOLUTION
WARNING: ANY USE BY YOU OF THE FOLLOWING STEPS PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides these steps "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.The CLSID of each custom control is saved in the project file (.VBP). The VBP file may be opened with Notepad or any text editor. If you know the new CLSID for the new version of the custom control, the VBP file can be modified to reflect this change in CLSIDs. NOTE: Version compatibility in custom controls is used to ensure that your new version of a custom control will not break backward compatibility with applications that may be using older versions of your custom control. Following the example below to modify the project file with the new CLSID could result in unexpected errors in your application. For example, if your custom control, named Custom.OCX, appears in your project, a line in the VBP file could read as follows:
Object={B0784T02-A67Y-11E0-8840-00DD00F7B36C}#1.0#0; Custom.OcxYou can modify the CLSID in the above line,
{B0784T02-A67Y-11E0-8840-00DD00F7B36C}with the new CLSID of the Custom.Ocx. Saving the VBP file and reopening the project with Visual Basic should solve the problem. To obtain the new CLSID of your custom control, you may need to search the system registry or use a tool such as OLE2VIEW.EXE that can provide such information. The utility, OLE2VIEW.EXE, can be downloaded from the Microsoft Internet site at http://www.microsoft.com. To find the download file, search for "OLE2VIEW."
STATUSThis behavior is by design.
REFERENCESFor additional information, see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q161137 TITLE : HOWTO: Use Project and Binary CompatibilitySee also the following section in the Visual Basic 5.0 Books Online: Visual Basic 5.0 Components Guide, Chapter 7, "Debugging, Testing, and Deploying Components" |
Keywords : kbenv kbtshoot kbui kbusage vb5all vb5howto VBKBAX VBKBComp VBKBCtrl VBKBDesignTime VBKBEnv VBKBVB kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |