#include <initguid.h>
#include <comdef.h>
#include <ole2.h>
#include <msxml2.h>
Go to the source code of this file.
◆ _COM_NO_STANDARD_GUIDS_
#define _COM_NO_STANDARD_GUIDS_ |
◆ IID_NULL_PPV_ARG
#define IID_NULL_PPV_ARG |
( |
|
Itype, |
|
|
|
ppType |
|
) |
| IID_##Itype, NULL, (void**)(ppType) |
◆ IID_PPV_ARG
#define IID_PPV_ARG |
( |
|
Itype, |
|
|
|
ppType |
|
) |
| IID_##Itype, (void**)(ppType) |
◆ SAFE_RELEASE
◆ CreateAndInitXMLDOMDocument()
Definition at line 64 of file xmldomparser.cpp.
65{
68 CLSCTX_INPROC_SERVER,
72
73
74 (*ppDoc)->put_async(VARIANT_FALSE);
75 (*ppDoc)->put_validateOnParse(VARIANT_FALSE);
76 (*ppDoc)->put_resolveExternals(VARIANT_FALSE);
77
79}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
#define IID_PPV_ARG(Itype, ppType)
Referenced by FillListView().
◆ InitXMLDOMParser()
◆ LoadXMLDocumentFromFile()
Definition at line 143 of file xmldomparser.cpp.
146{
148 _variant_t varFileName(lpszFilename);
149
150 if (!pDoc)
152
154 {
156 LONG lErrorCode = 0
L;
157
158 if (
SUCCEEDED(pDoc->get_parseError(&pXMLErr)) &&
159 SUCCEEDED(pXMLErr->get_errorCode(&lErrorCode)))
160 {
161 if ( !bIgnoreErrorsIfNonExistingFile ||
164 {
165 _bstr_t bstrErr;
166
167 if (
SUCCEEDED(pXMLErr->get_reason(&bstrErr.GetBSTR())))
168 {
169 LPWSTR lpszStr =
FormatString(
L"Failed to load DOM from '%wS': %wS", lpszFilename, (
wchar_t*)bstrErr);
172 }
173 }
174 }
175
177 }
178
179 return (
Success == VARIANT_TRUE);
180}
BOOL MemFree(IN PVOID lpMem)
DWORD FormatString(DWORD dwFlags, HINSTANCE hInstance, DWORD dwStringId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments)
#define ERROR_FILE_NOT_FOUND
#define _HRESULT_TYPEDEF_(x)
#define HRESULT_FROM_WIN32(x)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
Referenced by FillListView().
◆ LoadXMLDocumentFromResource()
Definition at line 82 of file xmldomparser.cpp.
84{
86 HRSRC hRes;
89 _bstr_t bstrXMLRes;
90
91 if (!pDoc)
93
94
98
102
104 if (lpXMLRes ==
NULL)
106
107
110 else
111 bstrXMLRes = (
LPCWSTR)lpXMLRes;
112
114 {
116 _bstr_t bstrErr;
117
118 if (
SUCCEEDED(pDoc->get_parseError(&pXMLErr)) &&
119 SUCCEEDED(pXMLErr->get_reason(&bstrErr.GetBSTR())))
120 {
122
124 lpszStr =
FormatString(
L"Failed to load DOM from resource '#%u': %wS", lpszXMLResName, (
wchar_t*)bstrErr);
125 else
126 lpszStr =
FormatString(
L"Failed to load DOM from resource '%wS': %wS", lpszXMLResName, (
wchar_t*)bstrErr);
127
129
131 }
132
134 }
135
138
139 return (
Success == VARIANT_TRUE);
140}
BOOL WINAPI IsTextUnicode(IN CONST VOID *lpv, IN INT iSize, IN OUT LPINT lpiResult OPTIONAL)
BOOL WINAPI FreeResource(HGLOBAL handle)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
static const WCHAR Cleanup[]
#define IS_INTRESOURCE(i)
static BSTR ConvertUTF8StringToBSTR(const char *pSrc)
Referenced by FillListView().
◆ UninitXMLDOMParser()