Microsoft KB Archive/190967

= BUG: Changing Implemented Class Does Not Give Compatibility Error =

Article ID: 190967

Article Last Modified on 1/8/2003

-

APPLIES TO


 * 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

-



This article was previously published under Q190967



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.



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."</li> In the Project Properties dialog, click on the Component Tab and select No Compatibility.</li> 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.</li> Create a new ActiveX dll project in Visual Basic.</li> Rename Class1 to "ClassX."</li> Select References from the Project menu, and add a reference to Ref1.</li>  Paste the following into ClassX's code window: Implements Class1

Private Sub Class1_Test End Sub </li> Compile Project1.dll by selecting Make Project1 from the File menu.</li> Select Project Properties from the Project Menu, and then select the component tab. Set Binary Compatibility with Project1.dll.</li> Select References from the Project menu, remove the reference to Ref1, and add a reference to Ref2.</li> Compile as Project2.dll. Note that the project compiles fine, whereas there should be an incompatibility error.</li></ol>

Additional query words: kbDSupport kbVBp600bug kbVBp500bug kbCompiler kbdss kbDSupport kbVBp

Keywords: kbbug KB190967

-

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

© Microsoft Corporation. All rights reserved.