Microsoft KB Archive/190078

= BUG: Error "BadImplementsRefInCompatLib" When You Recompile a Server That Contains a Project Compatible DLL =

Article ID: 190078

Article Last Modified on 10/15/2002

-

APPLIES TO


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

-



This article was previously published under Q190078



SYMPTOMS
A binary compatible server implements an interface from a dynamic-link library (DLL) (which defines interfaces), and this DLL is recompiled as project compatible so that its interface globally unique identifier (GUID) is changed. However, when you recompile the server that implements this interface, you receive the following error message:

BadImplementsReflnCompatLib



RESOLUTION
Interfaces must be defined and locked before they can be implemented in other components. Thus, make sure that you compile the DLL that defines interfaces as binary compatible (to maintain the interface GUIDs) and not project compatible to avoid the "BadImplementsReflnCompatLib" error message.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
This is a bug because it displays the "BadImplementsReflnCompatLib" error message instead of the following error message:

The binary compatibility DLL or EXE contains an implements type whose definition cannot be found.

If you click Help in the BadImplementsReflnCompatLib dialog box, the correct Help topic appears.

Steps to Reproduce Behavior
 Create a new ActiveX DLL project. Class1 is created by default. From the Project menu, click Project1 Properties. Change Project Name to MyServer, and then click OK.  In Class1, paste the following code: Public Sub Test ' End Sub  From the File menu, click Make MyServer.dll to make the interface DLL. From the File menu, click Add Project to add another new ActiveX DLL project to the current workspace. Change Project Name to MyNewServer.</li> From the Project menu, click References, select the MyServer check box, and then click OK.</li>  In Class1, paste the following code to implement the interface that is defined in MyServer.dll: Implements MyServer.Class1

Private Sub Class1_Test ' End Sub </li> From the File menu, click Make MyNewServer.dll.</li> From the Project menu, click MyNewServer Properties. On the Component tab, set version compatibility to Binary Compatibility with MyNewServer.dll, and then click OK.

NOTE: Project Compatibility is set automatically.</li> Close the code window for MyNewServer, and repeat step 4 to compile MyServer as MyServer.dll again. When you are prompted to replace the existing file, click Yes.</li> In the Project explorer window, click MyNewServer (MyNewServer) to highlight it. Repeat step 9 to compile MyNewServer as MyNewServer.dll again. When you are prompted to replace the existing file, click Yes. Notice that you receive the above-mentioned error message.</li></ol>

<div class="references_section">