The XMLDocument is an older XML parser, you want do create the DOMDocument parser. To do this, change the CLSID from CLSID_XMLDocument to CLSID_DOMDocument.
Also, you mentioned that you were in an MFC app, it might be a good idea to use the AfxOleInit method instead of CoInitializeEx. Directly initializing COM, while it will work, may cause problems for you down the road if you use any of MFC's COM support.
Originally posted by jmc_mod
The XMLDocument is an older XML parser, you want do create the DOMDocument parser. To do this, change the CLSID from CLSID_XMLDocument to CLSID_DOMDocument.
Also, you mentioned that you were in an MFC app, it might be a good idea to use the AfxOleInit method instead of CoInitializeEx. Directly initializing COM, while it will work, may cause problems for you down the road if you use any of MFC's COM support.
BSTRs are the typical method used to pass strings around in COM. There are a set of functions for dealing with BSTRS: SysAllocString, SysFreeString, SysAllocStringLen, etc.
Since you are in MFC, the easiest thing to do would be to store it in a CString and then call AllocSysString.
Note: NULL is a valid value for a BSTR, so you should be careful, and never directly assign a BSTR to a CString.
Bookmarks