Microsoft KB Archive/190197

= BUG: User Defined Type Not Defined Using Binary Compatibility =

Article ID: 190197

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition

-



This article was previously published under Q190197



SYMPTOMS
When compiling an ActiveX DLL or ActiveX EXE with Binary Compatibility, the following error occurs:

Compile Error : User defined type not defined



RESOLUTION
Turn off Binary Compatibility and compile the project. Visual Basic will highlight the line of code that contains the User Defined Type that is not defined. After resolving the problem, Binary Compatibility can be turned back on.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce
 Create a new ActiveX DLL project in Microsoft Visual Basic. Class1 is created by default.  Paste the following code into Class1: Option Explicit

Public Enum Colors Red Green Blue End Enum

Public Sub ChangeColor(NewColor As Colors) End Sub

 On the File menu, click Make Project1.dll. On the Project menu, click Project1 Properties, and then click the Component tab. In the Version Compatibility area, click Binary Compatibility, and then click OK. Comment out the Enum declaration in Class1.</li> On the File menu, click Make Project1.dll. Click OK when asked to replace the current file.</li> Visual Basic will display a dialog warning about breaking compatibility. For this demonstration, choose the option that will break compatibility.

NOTE: When Visual Basic warns about breaking compatibility, the Enum definition that was undefined was shown. The User Defined Type that raises this error will not always be identified by Visual Basic.</li> Visual Basic will display the following error:

User Defined Type Not Defined

</li> On the Project menu, click Project1 Properties, then click the Component tab.</li> In the Version Compatibility area, click to No Compatibility.</li> On the File menu, click Make Project1.dll. Click OK when asked to replace the current file. Note that Visual Basic will highlight the User Defined Type that is causing the error.</li></ol>

Additional query words: kbDSupport kbdss kbVBp500bug kbVBp600bug kbCompiler kbVBp

Keywords: kbbug KB190197

-

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

© Microsoft Corporation. All rights reserved.