我想在Visual C++中針對XSD模式驗證XML文件。我環顧了互聯網,我發現的MSXML例子似乎是最直接的。可能的標題衝突
我正在嘗試將this集成到我正在處理的項目中。我創建了XMLSchemaValidation
類來對某些XSD模式執行驗證,並使用相應的XSD文件名初始化對象。我在頭文件中的下列指令:
#import "C:\Windows\System32\msxml6.dll"
,但我開始收到以下錯誤的looot:
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上的位置。
我已經在stdafx.h中文件中刪除#define WIN32_LEAN_AND_MEAN
(Errors using msxml6.h on visual c++)
我在做什麼錯?
如果你可以發佈你的代碼,人們可以更好地幫助你。 – doptimusprime