CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2010
    Location
    Ukraine
    Posts
    2

    MSXML6: Attach schemas

    Hi! Next example is shown in SDK,

    Code:
    //...
    IXMLDOMDocument2Ptr pIXMLDOMDocument2;
    IXMLDOMSchemaCollection2Ptr pIXMLDOMSchemaCollection2Ptr;
    //...
    
      // Attach schemas
     pIXMLDOMDocument2->schemas = pIXMLDOMSchemaCollection2Ptr.GetInterfacePtr();
    But for MSXML6 I can't find the schemas member in IXMLDOMDocument2 interface (and also in IXMLDOMDocument3).

    So I tried to use next code
    //...
    IXMLDOMDocument3 *m_pXMLDoc;
    IXMLDOMSchemaCollection2 *m_pSchemaCollection;
    //...
    Code:
    HRESULT hr = S_FALSE;
    _variant_t varSchemaCollection;
    varSchemaCollection.vt = VT_DISPATCH;
    varSchemaCollection.pdispVal = m_pSchemaCollection;
    
    hr = m_pXMLDoc->setProperty(L"schema", varSchemaCollection);
    but something error occur (hr is E_FAIL). I am not sure that "schema" property exist, or maybe varSchemaCollection is initialized wrongly. How to make correctly? Thanks!

  2. #2
    Join Date
    Mar 2010
    Location
    Ukraine
    Posts
    2

    Re: MSXML6: Attach schemas

    Thanks! The problem was solved with putref_schemas() method.

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