title: Adding schema collection to SAXXMLReader60 instance, using MSXML 6.0
body: <p>I trying to write a xsd validator utility using MSXML 6.0. All is fine and nice except this one line :</p>
  
  <pre><code>this-&gt;myReader-&gt;putProperty(L"schemas", pXS);
  </code></pre>
  
  <p>This throws this error : <code>error C2664: 'ISAXXMLReader::putProperty' : cannot convert parameter 2 from 'MSXML2::IXMLDOMSchemaCollectionPtr' to 'VARIANT'</code> </p>
  
  <p>which is understandable but how can one add a schema instance to a reader? </p>
  
  <p>FYI <code>myReader</code> is this :</p>
  
  <pre><code>ISAXXMLReader * myReader;
  </code></pre>
  
  <p>and initialized like this : </p>
  
  <pre><code>HRESULT hr = CoCreateInstance( __uuidof(SAXXMLReader60), 
                                 NULL, 
                                 CLSCTX_ALL,
                                 __uuidof(ISAXXMLReader),
                                 (void **)&amp;this-&gt;myReader);
  </code></pre>
  
  <p>And pXS is : </p>
  
  <pre><code>MSXML2::IXMLDOMSchemaCollectionPtr   pXS;
  
  pXS.CreateInstance(__uuidof(MSXML2::XMLSchemaCache60), NULL, CLSCTX_INPROC_SERVER);
  </code></pre>
  
  <p><em>Some</em> of the links I read : </p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/ms762787(v=VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms762787(v=VS.85).aspx</a></p>
  
  <p><a href="http://support.microsoft.com/kb/309535" rel="nofollow">http://support.microsoft.com/kb/309535</a></p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/cc507429(v=VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/cc507429(v=VS.85).aspx</a></p>
  
  <p>As usual MSDN documentation is really nice..</p>
  
  <p>The example they provide works, but I need to collect all errors, so I translated the vb example in one of the links to C++. The only error which remains is this. Any help is appreciated.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>After following this nice link:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms766451(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ms766451(v=vs.85).aspx</a></p>
  
  <p>C++ section : </p>
  
  <p>The namespace to associate with the specified schema.
  The empty string, "", will associate the schema with the empty namespace, xmlns="".</p>
  
  <p>And doing this:</p>
  
  <pre><code>nResult = pIXMLDOMSchemaCollection2Ptr-&gt;add(_T(""), _T("c:\\temp\\collection.xsd"));
  </code></pre>
  
  <p>A nice crash happens. Does anyone know how on earth to add a schema without namespace in this thing?</p>