Microsoft KB Archive/291380

= FIX: You may receive several error messages regarding the redefinition of XML interfaces when you compile an Interface Definition Language (.idl) file in Visual C++ 6.0 =

Article ID: 291380

Article Last Modified on 6/2/2005

-

APPLIES TO


 * Microsoft XML Core Services 4.0
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q291380



SYMPTOMS
When you compile an Interface Definition Language (.idl) file which imports the Msxml2.idl file, you may receive several error messages regarding the redefinition of XML interfaces:

D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\msxml.idl(50) : error MIDL2003 : redefinition : XMLELEMTYPE_ELEMENT

D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\msxml.idl(51) : error MIDL2003 : redefinition : XMLELEMTYPE_TEXT

D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\msxml.idl(52) : error MIDL2003 : redefinition : XMLELEMTYPE_COMMENT



CAUSE
One of the other files that your .idl file imports, such as Ocild.idl, implicitly imports the Msxml.idl file, which causes duplication and results in the redefinition errors.



RESOLUTION
The Msxml2.idl file that ships with the Microsoft XML (MSXML) 3.0 Service Pack 1 Software Development Kit (SDK) resolves the problem when it is used with the Msxml.idl file that shipped with Visual C++ 6.0 (dated April 1998). To avoid the error, you just need to add the IMPORTED_MSXML macro as an option with the Microsoft Interface Definition Language (MIDL) compiler; for example:

midl /D IMPORTED_MSXML test.idl

NOTE: The fix in MSXML 3.0 SP1 does not resolve the redefinition problem that exists for the Msxml.idl that comes with the Windows Platform SDK that is dated February 2000.

You also need to have the MIDL Compiler version 5.03.0280. If you do not have it, you will receive the following error message:

midl\oleaut32.dll : error MIDL2020 : error generating type library : AddImplType failed : IXMLDOMDocument

You can download the latest Platform SDK from the following Microsoft Web site:

http://www.microsoft.com/msdownload/platformsdk/sdkupdate

To set up the Platform SDK, select Custom installation, then open the Tools section and select Platform SDK Tools. After you install this, MSDEV uses the new version of MIDL.



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

This bug was corrected in Microsoft XML 3.0 Service Pack 1 SDK.

For additional information on other fixes included in Microsoft XML 3.0 Service Pack 1, click the article number below to view the article in the Microsoft Knowledge Base:

292935 INFO: List of Issues Fixed in Microsoft XML 3.0 Service Pack 1

For the latest information and downloads of MSXML, refer to the following MSDN Web site at:

http://msdn.microsoft.com/xml/default.asp



MORE INFORMATION
To reproduce this problem, add the following code to your .idl file and then compile it using the MIDL compiler: import &quot;msxml2.idl&quot;; import &quot;oaidl.idl&quot;; import &quot;ocidl.idl&quot;;

Keywords: kberrmsg kbbug kbfix kbqfe kbmsxml300sp1fix kbmsxmlnosweep KB291380

-

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

© Microsoft Corporation. All rights reserved.