CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Location
    Belgium (Antwerp)
    Posts
    4

    XML ProcessingInstruction Problem

    Can anyone tell me way the CreateComment in the code below is working fine and the CreateProcessingInstruction is generating an exception (the object is not created.

    xml::IXMLDOMDocumentPtr spDoc;
    xml::IXMLDOMNodeListPtr spNodeListTmp;

    xml::IXMLDOMElementPtr spRootElement;
    xml::IXMLDOMElementPtr spProduct;
    xml::IXMLDOMElementPtr spElektronikonDefinition;
    xml::IXMLDOMElementPtr spProductDefinition;
    xml::IXMLDOMElementPtr spStatus;
    xml::IXMLDOMProcessingInstructionPtr spIXMLDOMProcessingInstruction;
    xml::IXMLDOMCommentPtr spComment;

    hRes=spDoc.CreateInstance(__uuidof(xml:OMDocument));
    if (FAILED(hRes)) return FALSE;

    try
    {
    spComment=spDoc->createComment("test");
    }
    catch (...)
    {
    MessageBox(NULL, _T("Exception occurred"), _T("Error"), MB_OK);
    }
    try
    {
    spIXMLDOMProcessingInstruction=spDoc->createProcessingInstruction(_bstr_t("xml"), _bstr_t("Version=""1.0"""));
    }
    catch (...)
    {
    MessageBox(NULL, _T("Exception occurred"), _T("Error"), MB_OK);
    }
    spDoc->appendChild(spIXMLDOMProcessingInstruction);





  2. #2
    Join Date
    Jan 2002
    Location
    Belgium (Antwerp)
    Posts
    4

    Re: XML ProcessingInstruction Problem

    sorry guys I should have written

    spIXMLDOMProcessingInstruction=spDoc->createProcessingInstruction(_bstr_t("xml"), _bstr_t("version=\"1.0\""));


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured