fperks

Unserialization of an arcobject in C++?

Discussion created by fperks on Apr 7, 2010
Latest reply on Apr 7, 2010 by fperks
Hi, i basically have a IPolynomalXform operator, that has been serialized to XML. How can i unserialize this xml file into a ArcObject? Its very vaguley mentioned, in the EDN documentation, however i cannot find any examples.

My understanding is i need to use a combination of IXML* objects to read->unserialize->get_object->?????

HRESULT GeoTransformer::GetGeodataXFormFromFile(__in const ATL::CComBSTR& transformationFile)
{
 USES_CONVERSION;
 IXMLStreamPtr ipXMLStream(CLSID_XMLStream);
 IXMLSerializerPtr ipXMLSerializer(CLSID_XMLSerializer);
 
 ipXMLStream->LoadFromFile(transformationFile);
 
 
 IXMLReaderPtr ipXMLReader(CLSID_XMLReader);
 hr = ipXMLReader->ReadFrom(static_cast<IStreamPtr>(ipXMLStream));
 if(FAILED(hr))
 {
  std::cerr << "[ERROR]: Cannot read XML transformation file [ " << W2A(transformationFile) << " ]" << std::endl;
  return hr;
 }
 
 hr = ipXMLSerializer->ReadObject(ipXMLReader, ?????, ?????, ?????);
 if(FAILED(hr))
 {
  std::cerr << "[ERROR]: Cannot deserialize XML Transformation file [ " << W2A(transformationFile) << " ]" << std::endl;
  return hr;
 }
}


Any combination of parameters or attempts always results in an error. Does anyone know?

Outcomes