Microsoft KB Archive/255757

= PRB: Circular Dependency Error When UDT Is Not In Base Class Module =

Article ID: 255757

Article Last Modified on 5/12/2003

-

APPLIES TO


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

-



This article was previously published under Q255757



SYMPTOMS
A circular dependency compilation error can occur when a User Defined Type (UDT) is defined in a class module that implements another base class interface, and the base class module has references to the UDT.



RESOLUTION
Move the UDT definition to the base class module.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Start a new Visual Basic ActiveX DLL project. Class1 is created by default.  Add the following code to the General Declarations section of Class1: Public Function myFunct As myUDT End Function  On the Project menu, select Add Class Module, and then add Class2 to the project.  Add the following code to the General Declarations section of Class2: Public Type myUDT iNum As Integer End Type

Implements Class1

Private Function Class1_myFunct As myUDT End Function  Run the project. The following error is raised:

Compile Error:

Circular dependencies between modules.

 To correct the problem, move the definition of myUDT from Class2 to Class1 and run the project again. No error occurs.</li></ol>

Additional query words: UDType

Keywords: kbbug kbinprocsvr kbctrlcreate kbprb kbcompiler KB255757

-

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

© Microsoft Corporation. All rights reserved.