I'm trying to validate an XML document but i have a big issue: when i call the CreateInstance method for the schema i get an E_POINTER error. In fact the create instance succes, but the pointer to the SchemaColletion is 0x0000000, so the add command fails! here is the code: HRESULT hr; if (!opened) return; try { MSXML2::IXMLDOMSchemaCollection2Ptr schema; hr=schema.CreateInstance(__uuidof(MSXML2::XMLSchemaCache40)); (hr == 0) ? 0: printf("KO"); CXmlString dsigSchema(dsxsd); CComVariant dsigSchemaFileName; dsigSchemaFileName.vt = VT_BSTR; dsigSchemaFileName.bstrVal = dsigSchema.AllocSysString(); **********THIS FAILS WITH A E_POINTER ERROR************ hr=schema->add(L"http://www.w3.org/2000/09/ xmldsig#",dsigSchemaFileName); CXmlString tslSchema(TSLxsd); CComVariant tslSchemaFileName; tslSchemaFileName.vt = VT_BSTR; tslSchemaFileName.bstrVal = tslSchema.AllocSysString(); schema->add(L"http://uri.etsi.org/02231/v2#",tslSchemaFileName); MSXML2::IXMLDOMDocument2Ptr doc; hr=doc.CreateInstance(__uuidof(MSXML2::DOMDocument40)); If someone can help....please!
* mongiosan@gmail.com wrote in microsoft.public.xml: >I'm trying to validate an XML document but i have a big issue: when i >call the CreateInstance method for the schema i get an E_POINTER >error. In fact the create instance succes, but the pointer to the >SchemaColletion is 0x0000000, so the add command fails! Now does the CreateInstance call fail with E_POINTER or not? > HRESULT hr; > > if (!opened) return; > try { > > MSXML2::IXMLDOMSchemaCollection2Ptr schema; > > hr=schema.CreateInstance(__uuidof(MSXML2::XMLSchemaCache40)); > (hr == 0) ? 0: printf("KO"); > > CXmlString dsigSchema(dsxsd); > CComVariant dsigSchemaFileName; > dsigSchemaFileName.vt = VT_BSTR; > dsigSchemaFileName.bstrVal = dsigSchema.AllocSysString(); > > **********THIS FAILS WITH A E_POINTER ERROR************ > hr=schema->add(L"http://www.w3.org/2000/09/ >xmldsig#",dsigSchemaFileName); Perhaps there is something wrong with your CXmlString class or the dsxsd parameter? What is dsigSchemaFileName at this point exactly? -- Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
On 30 Mag, 14:58, Bjoern Hoehrmann wrote: > * mongio...@gmail.com wrote in microsoft.public.xml: > > >I'm trying to validate an XML document but i have a big issue: when i > >call the CreateInstance method for the schema i get an E_POINTER > >error. In fact the create instance succes, but the pointer to the > >SchemaColletion is 0x0000000, so the add command fails! > > Now does the CreateInstance call fail with E_POINTER or not? > > > > > HRESULT hr; > > > if (!opened) return; > > try { > > > MSXML2::IXMLDOMSchemaCollection2Ptr schema; > > > hr=schema.CreateInstance(__uuidof(MSXML2::XMLSchemaCache40)> > (hr == 0) ? 0: printf("KO"); > > > CXmlString dsigSchema(dsxsd); > > CComVariant dsigSchemaFileName; > > dsigSchemaFileName.vt = VT_BSTR; > > dsigSchemaFileName.bstrVal = dsigSchema.AllocSysString(); > > > **********THIS FAILS WITH A E_POINTER ERROR************ > > hr=schema->add(L"http://www.w3.org/2000/09/ > >xmldsig#",dsigSchemaFileName); > > Perhaps there is something wrong with your CXmlString class or the dsxsd > parameter? What is dsigSchemaFileName at this point exactly? > -- > Björn Höhrmann · mailto:bjo...@hoehrmann.de ·http://bjoern.hoehrmann.de > Weinh. Str. 22 · Telefon: (0)621/4309674 ·http://www.bjoernsworld.de > 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·http://www.websitedev.de/Ops, sorry for annoying..... the hr was "80040154 interface not registered" , i didn't have registered the msxml2. "regsvr32 c:\WINDOWS\system32\msxml2.dll" .... and the sun shine again! thanks anyway!!!