Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


IXMLDOMDocument::load fails on Windows Mobile

From: "Waleri Todorov" <nomail@------.--->
To: NULL
Date: 11/19/2009 3:55:00 PM
I am trying to load a XML document from an IStream.
The code belows works fine on WIN32 but fails on Windows Mobile.
File is OK, returned stream is OK (I can read from it) but the load() on the 
last line always fail.
Reported error is "invalid character" but IXMLDOMParseError doesn't give me 
any valid line/pos/filepos
Furthermore, I tried to create a document manually (creating and adding 
nodes) then save it to an IStream, then rewind the stream and pass it to 
load() it also fails (same error).

Here is the code:

  CoInitializeEx(0,COINIT_MULTITHREADED);
  HRESULT rv;

  HANDLE hFile = 
CreateFile(XML_FILE,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,0);
  DWORD dwSize = GetFileSize(hFile,NULL);
  HGLOBAL hGlobal = GlobalAlloc(GMEM_FIXED,dwSize);
  ReadFile(hFile,hGlobal,dwSize,&dwSize,NULL);

  IStream* pStream;
  CreateStreamOnHGlobal(hGlobal,TRUE,&pStream);

  IXMLDOMDocument* pDocument;
  rv = 
CoCreateInstance(CLSID_DOMDocument,NULL,CLSCTX_INPROC,IID_IXMLDOMDocument,(void**) 
&pDocument);
  pDocument->put_async(VARIANT_FALSE);

  VARIANT var = { 0 };
  var.vt = VT_UNKNOWN;
  var.punkVal = pStream;

  VARIANT_BOOL err;
  rv = pDocument->load(var,&err);




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent