BUG: User Defined Type Referenced by User Control Raises "Class not registered" Error Message (237922)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q237922 SYMPTOMS
A User control has a Public User Defined Type (UDT). The User control has a Public function that has the UDT in the function declaration as either an argument or the return type. This User control, Control A, is then referenced in another User control, Control B. Control B is used in a standard EXE and distributed to another computer. If a new Visual Basic project on the second computer references Control B, when Control B is instantiated on a form, the following error occurs:
Class not registered. Looking for object with CLSID: {...}
CAUSE
The CLISID of the OCA file for Control A is being used to reference the UDT. This is incorrect. The OCA file should only be used at design time.
RESOLUTION
Define all UDTs in a separate ActiveX DLL and reference this DLL in both User controls, Control A and Control B, and the Standard EXE project. When the Standard EXE project is distributed, the ActiveX DLL is distributed as well.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
224185 BUG: User Defined Type in Public Function of a User Control Fails to Run
Modification Type: | Major | Last Reviewed: | 5/13/2003 |
---|
Keywords: | kbAppSetup kbBug kbCtrl kbDeployment kbpending kbwizard KB237922 |
---|
|