Here is the original post on the string stream implementation.
This is how you would use it.
HRESULT hr = S_OK;
LPWSTR pszXml = NULL;
ISequentialStream *pStream = NULL;
IXmlReader *pReader = NULL;
hr = GetXmlString(&pszXml);
if (S_OK == hr)
{
hr = CStringStream::Create(pszXml, &pStream);
}
if (S_OK == hr)
{
hr = CreateXmlReader(__uuidof(IXmlReader), (void**)&pReader, NULL);
}
if (S_OK == hr)
{
hr = pReader->SetInput(pStream);
}
//
// rest of your xml parsing here.
//
// cleanup
if (pReader)
{
pReader->Release();
}
if (pStream)
{
pStream->Release();
}
if (pszXml)
{
free(pszXml);
}
No comments:
Post a Comment