Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, I think Patrick is right. I took your code and made a quick ATL EXE project named getxmltest. I added this line after #include directives</p> <pre><code>#import "MSXML3.DLL" </code></pre> <p>removed the post-build event which registers the component because I dont want to expose any component from the exe but only have all ATL headers and libs already referenced and added the following code to the _tWinMain</p> <pre><code>extern "C" int WINAPI _tWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpCmdLine*/, int nShowCmd) { CoInitialize(NULL); { //declare string pointer _bstr_t markup; //initialize markup to some well formed XML &lt;- //declare and initialize XML Document MSXML2::IXMLDOMDocument2Ptr pXMLDoc; HRESULT hr = pXMLDoc.CreateInstance(__uuidof(MSXML2::DOMDocument)); pXMLDoc-&gt;async = VARIANT_FALSE; pXMLDoc-&gt;validateOnParse = VARIANT_TRUE; pXMLDoc-&gt;preserveWhiteSpace = VARIANT_TRUE; //load markup into XML document VARIANT_BOOL vtBoolResult = pXMLDoc-&gt;loadXML(L"&lt;XML&gt;&lt;/XML&gt;"); //do some changes to the XML file&lt;- //get back string from XML doc markup = pXMLDoc-&gt;Getxml(); //&lt;-- this retrieves RUBBISH (not anymore...) ATLTRACE("%S", (BSTR)markup.GetBSTR()); } CoUninitialize(); return _AtlModule.WinMain(nShowCmd); } </code></pre> <p>The resulting trace lines were the following...</p> <pre><code>'getxmltest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll' &lt;XML&gt;&lt;/XML&gt; 'getxmltest.exe': Unloaded 'C:\Windows\SysWOW64\msxml3.dll' The program '[6040] getxmltest.exe: Native' has exited with code 0 (0x0). </code></pre> <p>Where we can see the string we entered initially.. I didnt add any logic to the code because I though this was enough to display the resulting xml after processing it with the MSXML engine. Obviously you may do some more testing using this code and see what happens next.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload