INFO: Effect of Priority Setting in the References Dialog
Article ID: 142832
Article Last Modified on 5/7/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
- Microsoft Visual Basic 4.0 Standard Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 16-bit Enterprise Edition
- Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
This article was previously published under Q142832
SUMMARY
This article illustrates the effects of changing the priority of
references in the References dialog box.
MORE INFORMATION
Note: Changing the order of references in an existing project may break
code. For example, given a project that has a reference only to OLE server
A (which defines the only "Window" object) and code in 20 different modules
that simply uses the syntax "Window". In this program all references to
"Window" will resolve to "A.Window". Now suppose the need arises in a
single module for a "Window" object provided by server B. While writing
code in this module, a programmer switches the priority of server A and B
so that the need to use "B.Window" is removed. This causes the code in the
20 other modules to break. Where "Window" used to resolve to "A.Window", it
now resolves to "B.Window" because server B is listed before server A in
the list of available references. In this case the references should be
left in the original order and all calls to "Window" in the single module
should be explicitly qualified (for example: "B.Window").
REFERENCES
For more information on this subject, including other methods to manipulate
the way Visual Basic chooses what object to use, please see the following
article(s) in the Microsoft Knowledge Base:
129867
How to Debug Typelib Shadowing
Additional query words: kbVBp400 kbVBp500 kbVBp600 kbVBp kbdsd kbDSupport kbCompiler
Keywords: kbinfo KB142832