Microsoft Knowledge Base Email Alertz

(291380) - 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) :...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 291380 - Last Review: June 2, 2005 - Revision: 3.3

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

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 (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  (http://kbalertz.com/Feedback.aspx?kbNumber=292935/EN-US/ ) 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 (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 "msxml2.idl";
import "oaidl.idl";
import "ocidl.idl";
				

APPLIES TO
  • Microsoft XML Parser 3.0
  • Microsoft Visual C++ 6.0 Enterprise Edition
  • Microsoft Visual C++ 6.0 Professional Edition
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
Keywords: 
kberrmsg kbqfe kbbug kbfix kbmsxml300sp1fix kbmsxmlnosweep KB291380
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Alger, Lin - addre NOSPAM-AT-NOSPAM ebtnet.net Report As Irrelevant  
Written: 7/11/2005 7:27 PM
I tried to apply SAX XML reader in my application. However, I get some error when I compile my application, and those errors were from Msxml2.idl, such as message below. C:\Program Files\Windows CE Tools\wce400\STANDARDSDK\Include\emulator\Msxml2.idl(12) : error C2501: 'cpp_quote' : missing storage-class or type specifiers or C:\Program Files\Windows CE Tools\wce400\STANDARDSDK\Include\emulator\Msxml2.idl(34) : error C2143: syntax error : missing ';' before 'string' I think Msxml2.idl should be completed, but I still receieve all error messages when I try to compile my application, even thought I remove all my codes and .H files. Does any one can tell my what happen? How to solve those problems? thx.