3

Visual C++ で XSD スキーマに対して XML ファイルを検証したいと考えています。インターネットを調べたところ、見つけた MSXML の例が最も簡単なように思えました。

これを私が取り組んでいるプロジェクトに統合しようとしています。特定の XSD スキーマの検証を実行するクラスを作成XMLSchemaValidationし、対応する XSD ファイル名でオブジェクトを初期化しました。ヘッダー ファイルに次のディレクティブがあります。

#import "C:\Windows\System32\msxml6.dll"

しかし、次のエラーが発生し始めました。

7>d:\proiecte\wtlcommon\basegui\gdiplushelpers.h(28): error C2872: 'Font' : ambiguous symbol
7>          could be 'c:\program files (x86)\microsoft visual studio 10.0\vc\include\comdef.h(312) : Font'
7>          or       'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gdiplusheaders.h(244) : Gdiplus::Font'

そして私も得る:

7>...\wizarddlgskin.h(96): error C2259: 'Font' : cannot instantiate abstract class
7>          due to following members:
7>          'HRESULT IUnknown::QueryInterface(const IID &,void **)' : is abstract
7>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\unknwn.h(116) : see declaration of 'IUnknown::QueryInterface'
7>          'ULONG IUnknown::AddRef(void)' : is abstract
7>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\unknwn.h(120) : see declaration of 'IUnknown::AddRef'
7>          'ULONG IUnknown::Release(void)' : is abstract
7>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\unknwn.h(122) : see declaration of 'IUnknown::Release'
7>          'HRESULT IDispatch::GetTypeInfoCount(UINT *)' : is abstract
7>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(2123) : see declaration of 'IDispatch::GetTypeInfoCount'
7>          'HRESULT IDispatch::GetTypeInfo(UINT,LCID,ITypeInfo **)' : is abstract
7>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(2126) : see declaration of 'IDispatch::GetTypeInfo'
7>          'HRESULT IDispatch::GetIDsOfNames(const IID &,LPOLESTR *,UINT,LCID,DISPID *)' : is abstract
7>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(2131) : see declaration of 'IDispatch::GetIDsOfNames'
7>          'HRESULT IDispatch::Invoke(DISPID,const IID &,LCID,WORD,DISPPARAMS *,VARIANT *,EXCEPINFO *,UINT *)' : is abstract
7>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(2138) : see declaration of 'IDispatch::Invoke'

最初は#import <msxml.dll>サンプル コードのようにしましたが、MSXML のインストールでは、W7 で言う場所にファイルが配置されません。

#define WIN32_LEAN_AND_MEANstdafx.h ファイルで既に削除しました ( Visual C++ で msxml6.h を使用するとエラーが発生します)

私は何を間違っていますか?

4

1 に答える 1