Click here to Skip to main content
15,905,971 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: XML namespace problem i think Pin
LCI14-Jun-05 7:24
LCI14-Jun-05 7:24 
GeneralRe: XML namespace problem i think Pin
Tom Archer14-Jun-05 7:34
Tom Archer14-Jun-05 7:34 
GeneralRe: XML namespace problem i think Pin
LCI14-Jun-05 7:41
LCI14-Jun-05 7:41 
GeneralRe: XML namespace problem i think Pin
Tom Archer14-Jun-05 8:25
Tom Archer14-Jun-05 8:25 
GeneralRe: XML namespace problem i think Pin
Tom Archer14-Jun-05 8:31
Tom Archer14-Jun-05 8:31 
GeneralRe: XML namespace problem i think Pin
LCI14-Jun-05 8:51
LCI14-Jun-05 8:51 
GeneralRe: XML namespace problem i think Pin
Tom Archer14-Jun-05 10:37
Tom Archer14-Jun-05 10:37 
GeneralRe: XML namespace problem i think Pin
LCI14-Jun-05 10:56
LCI14-Jun-05 10:56 
That is very cool...
Thanks for showing me that.

I am now able to continue development but have another question. Just attempting a simple task of trying to write


ThisForm

to an XML file. I wrote the code below, but am stuck at the appendChild line and the line after. Do i really need an IXMLDOMNodePtr?? How would i do it without?

MSXML2::IXMLDOMDocumentPtr pIXMLDOMDocument;
MSXML2::IXMLDOMProcessingInstruction *pIXMLDOMProcessing =NULL;
MSXML2::IXMLDOMNodePtr pNode;
MSXML2::IXMLDOMNode *pNode1 = NULL;
MSXML2::IXMLDOMElementPtr pIXMLDOMElement;



//Put some checks to create directory if not there
_variant_t varString = "C:\\XML\\myXML.xml";
// Initialize pIXMLDOMDocument (create a DOMDocument).
hr = CoInitialize(NULL);
hr = pIXMLDOMDocument.CreateInstance("Msxml2.DOMDocument.4.0");

// Load document.
if (pIXMLDOMDocument->load(varString)!= VARIANT_TRUE)
{
// trace(ERROR,"Error loading XML file");
}
//Populate the xml document
//Create elements
pIXMLDOMElement = pIXMLDOMDocument->createElement(BSTR(L"Form"));
hr = pNode->put_text (BSTR(L"ThisForm"));
if (SUCCEEDED(hr))
{
// Create a processing instruction element.
pIXMLDOMProcessing = pIXMLDOMDocument->createProcessingInstruction(BSTR (L"xml"), BSTR(L"version=\"1.0\""));
pNode = pIXMLDOMDocument->appendChild(pNode1);
pIXMLDOMDocument->putref_documentElement(pIXMLDOMElement);

}

//Save DOM to a file
hr = pIXMLDOMDocument->save(varString);
GeneralRe: XML namespace problem i think Pin
Tom Archer14-Jun-05 11:20
Tom Archer14-Jun-05 11:20 
GeneralRe: XML namespace problem i think Pin
LCI14-Jun-05 11:30
LCI14-Jun-05 11:30 
GeneralRe: XML namespace problem i think Pin
Tom Archer14-Jun-05 11:35
Tom Archer14-Jun-05 11:35 
GeneralRe: XML namespace problem i think Pin
LCI14-Jun-05 11:37
LCI14-Jun-05 11:37 
GeneralRe: XML namespace problem i think Pin
LCI14-Jun-05 11:48
LCI14-Jun-05 11:48 
GeneralRe: XML namespace problem i think Pin
Tom Archer14-Jun-05 12:17
Tom Archer14-Jun-05 12:17 
GeneralRe: XML namespace problem i think Pin
LCI15-Jun-05 5:56
LCI15-Jun-05 5:56 
GeneralMultiple languages in single resource file Pin
senseilee14-Jun-05 3:38
senseilee14-Jun-05 3:38 
GeneralRe: Multiple languages in single resource file Pin
Blake Miller14-Jun-05 9:19
Blake Miller14-Jun-05 9:19 
General[out] parameters for ActiveX control interface Pin
Ian Bowler14-Jun-05 6:31
Ian Bowler14-Jun-05 6:31 
GeneralRe: [out] parameters for ActiveX control interface Pin
Ian Bowler14-Jun-05 8:36
Ian Bowler14-Jun-05 8:36 
Generalbizarre asm problem Pin
heebiejeebies14-Jun-05 5:19
heebiejeebies14-Jun-05 5:19 
GeneralCOleDateTime AddDays() Pin
DanYELL14-Jun-05 4:57
DanYELL14-Jun-05 4:57 
GeneralRe: COleDateTime AddDays() Pin
David Crow14-Jun-05 2:10
David Crow14-Jun-05 2:10 
GeneralRe: COleDateTime AddDays() Pin
DanYELL14-Jun-05 5:56
DanYELL14-Jun-05 5:56 
GeneralRe: COleDateTime AddDays() Pin
David Crow14-Jun-05 3:03
David Crow14-Jun-05 3:03 
GeneralConvert CString to CTime / COleDateTime Pin
P-Rex14-Jun-05 4:39
P-Rex14-Jun-05 4:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.