Finally I have been able to display the Html contents myself (couldn't get any help from internet and stackoverflow but i wanted to give the code on stackoverflow so that it would be helpful for someone doing same thing in future) I have done it using IHTMLDocument2 interface and IPersistStreamInit and IMarkupContainer and IMarkupPointer .
The code is as follows-
IHTMLDocument2 * pDoc=NULL;
HRESULT hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IHTMLDocument2, (LPVOID *) &pDoc);
if (pDoc)
{
IPersistStreamInit *pPersist = NULL;
pDoc->QueryInterface(IID_IPersistStreamInit,(LPVOID *) &pPersist);
if (pPersist)
{
IMarkupServices *pMS = NULL;
pPersist->InitNew();
pPersist->Release();
pDoc->QueryInterface(IID_IMarkupServices,(LPVOID *) &pMS);
if (pMS)
{
IMarkupContainer *pMC = NULL;
IMarkupPointer *pMkStart = NULL;
IMarkupPointer *pMkFinish = NULL;
pMS->CreateMarkupPointer(&pMkStart);
pMS->CreateMarkupPointer(&pMkFinish);
pMS->ParseString("you can see the syntax on msdn i don't want to give a spoon feed");
if (pMC)
{
IHTMLDocument2 *pNewDoc = NULL;
pMC->QueryInterface(IID_IHTMLDocument,(LPVOID *) &pNewDoc);
if (pNewDoc)
{
IHTMLElement *pBody;
pNewDoc->get_body(&pBody);
if (pBody)
{
BSTR strText;
pBody->get_innerText(&strText);
hr = instance->CreatePreviewWindowForHtml(strText);
//this function is responsible for creating the preview at preview pane i have created it
// myself and passed the html contents which are converted to strText and is of the type BSTR .
SysFreeString(strText);
pBody->Release();
}
pNewDoc->Release();
}
pMC->Release();
}
if (pMkStart)
pMkStart->Release();
if (pMkFinish)
pMkFinish->Release();
pMS->Release();
pMS->Release();
}
}
pDoc->Release();
}
return true;
}
I hope that could be very useful to someone .It will give the idea to do but i don't want to give a spoon feed so commented some part but its 80% of the solution.