21 if (!pSrc)
return NULL;
25 if (cwch == 0)
return NULL;
74 (*ppDoc)->put_async(VARIANT_FALSE);
75 (*ppDoc)->put_validateOnParse(VARIANT_FALSE);
76 (*ppDoc)->put_resolveExternals(VARIANT_FALSE);
104 if (lpXMLRes ==
NULL)
111 bstrXMLRes = (
LPCWSTR)lpXMLRes;
118 if (
SUCCEEDED(pDoc->get_parseError(&pXMLErr)) &&
119 SUCCEEDED(pXMLErr->get_reason(&bstrErr.GetBSTR())))
124 lpszStr =
FormatString(
L"Failed to load DOM from resource '#%u': %wS", lpszXMLResName, (
wchar_t*)bstrErr);
126 lpszStr =
FormatString(
L"Failed to load DOM from resource '%wS': %wS", lpszXMLResName, (
wchar_t*)bstrErr);
139 return (
Success == VARIANT_TRUE);
145 BOOL bIgnoreErrorsIfNonExistingFile)
148 _variant_t varFileName(lpszFilename);
156 LONG lErrorCode = 0
L;
158 if (
SUCCEEDED(pDoc->get_parseError(&pXMLErr)) &&
159 SUCCEEDED(pXMLErr->get_errorCode(&lErrorCode)))
161 if ( !bIgnoreErrorsIfNonExistingFile ||
167 if (
SUCCEEDED(pXMLErr->get_reason(&bstrErr.GetBSTR())))
169 LPWSTR lpszStr =
FormatString(
L"Failed to load DOM from '%wS': %wS", lpszFilename, (
wchar_t*)bstrErr);
179 return (
Success == VARIANT_TRUE);
BOOL MemFree(IN PVOID lpMem)
void WINAPI _com_issue_error(HRESULT hr)
BOOL WINAPI IsTextUnicode(IN CONST VOID *lpv, IN INT iSize, IN OUT LPINT lpiResult OPTIONAL)
#define MultiByteToWideChar
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)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static const WCHAR Cleanup[]
DWORD FormatString(DWORD dwFlags, HINSTANCE hInstance, DWORD dwStringId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments)
HRESULT load([in] VARIANT xmlSource, [out, retval] VARIANT_BOOL *isSuccessful)
HRESULT loadXML([in] BSTR bstrXML, [out, retval] VARIANT_BOOL *isSuccessful)
#define ERROR_FILE_NOT_FOUND
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
DWORD WINAPI GetLastError(void)
#define _HRESULT_TYPEDEF_(x)
#define HRESULT_FROM_WIN32(x)
#define IS_INTRESOURCE(i)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HRESULT InitXMLDOMParser(VOID)
BOOL LoadXMLDocumentFromResource(IXMLDOMDocument *pDoc, LPCWSTR lpszXMLResName)
BOOL LoadXMLDocumentFromFile(IXMLDOMDocument *pDoc, LPCWSTR lpszFilename, BOOL bIgnoreErrorsIfNonExistingFile)
HRESULT CreateAndInitXMLDOMDocument(IXMLDOMDocument **ppDoc)
static BSTR ConvertUTF8StringToBSTR(const char *pSrc)
#define IID_PPV_ARG(Itype, ppType)
void UninitXMLDOMParser(void)