BUG: Changing Implemented Class Does Not Give Compatibility Error
ID: Q190967
|
The information in this article applies to:
-
Microsoft Visual Basic Professional and Enterprise Editions for Windows, versions 5.0, 6.0
SYMPTOMS
If a Visual Basic Class implements an interface of a referenced dll, then
the implemented dll is removed and replaced with a different dll which
contains the same interface names as the first reference, an
incompatibility error is not generated when recompiling the dll with Binary
Compatibility set.
For example, if Project1.dll implements Class1 in MyFirst.dll, then the
reference to MyFirst.dll is removed and replaced with a reference to
MySecond.dll (which also contains a Class1), recompiling Project1 does not
generate a compatibility error.
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.
MORE INFORMATION
Steps to Reproduce
- Create a new ActiveX DLL Project in Microsoft Visual Basic. Class1 will
be created by default.
- Select Project Properties from the Project menu.
- Change the Project Name to "Ref1."
- Paste the following code into Class1's code window.
Public Sub Test()
End Sub
- Compile Ref1.Dll by selecting Make Ref1.Dll from the File menu.
- Return to the Project Properties and change the Project name to "Ref2."
- In the Project Properties dialog, click on the Component Tab and select
No Compatibility.
- Make Ref2.dll by selecting Make Ref1 from the File menu.
NOTE: You will need to manually change the dll name from Ref1.dll to
Ref2.dll.
- Create a new ActiveX dll project in Visual Basic.
- Rename Class1 to "ClassX."
- Select References from the Project menu, and add a reference to Ref1.
- Paste the following into ClassX's code window:
Implements Class1
Private Sub Class1_Test()
End Sub
- Compile Project1.dll by selecting Make Project1 from the File menu.
- Select Project Properties from the Project Menu, and then select the
component tab. Set Binary Compatibility with Project1.dll.
- Select References from the Project menu, remove the reference to Ref1,
and add a reference to Ref2.
- Compile as Project2.dll. Note that the project compiles fine, whereas
there should be an incompatibility error.
Additional query words:
kbDSupport kbVBp600bug kbVBp500bug kbCompiler kbdss kbDSupport kbVBp
Keywords : kbGrpVB
Version :
Platform : WINDOWS
Issue type : kbbug