A
Alexei
I am trying to use the WebBrowser control in VC++/MFC application to view MS
Word documents by calling Navigate(m_sDocFile, NULL, NULL, NULL, NULL);
I want the document to be in read-only mode when it is viewed in the control.
I am trying to use the the DocumentComplete event to get the default
IDispatch interface pointer for the hosted document object but that is where
I get stuck as I have no idea which Word interface I can query to access and
set that property.
Thanks
Alexei
void CWebBrowserTestDlg:ocumentCompleteExplorer1(LPDISPATCH pDisp,
VARIANT* URL)
{
HRESULT hr = S_OK;
IWebBrowser2* pWB = NULL;
hr = pDisp->QueryInterface(IID_IWebBrowser2,
reinterpret_cast<void**>(&pWB));
IDispatch* pDocDisp = NULL;
// get the default IDispatch interface pointer
// for the hosted document object
hr = pWB->get_Document(&pDocDisp);
if (pDocDisp)
{
VARIANT v;
VariantInit(&v);
I????????* pDoc = NULL; // Which Interface should I use here???
hr = pDocDisp->QueryInterface(IID_????????, reinterpret_cast<void
**>(&pDoc));
if (pDoc)
{
// do stuff
}
Word documents by calling Navigate(m_sDocFile, NULL, NULL, NULL, NULL);
I want the document to be in read-only mode when it is viewed in the control.
I am trying to use the the DocumentComplete event to get the default
IDispatch interface pointer for the hosted document object but that is where
I get stuck as I have no idea which Word interface I can query to access and
set that property.
Thanks
Alexei
void CWebBrowserTestDlg:ocumentCompleteExplorer1(LPDISPATCH pDisp,
VARIANT* URL)
{
HRESULT hr = S_OK;
IWebBrowser2* pWB = NULL;
hr = pDisp->QueryInterface(IID_IWebBrowser2,
reinterpret_cast<void**>(&pWB));
IDispatch* pDocDisp = NULL;
// get the default IDispatch interface pointer
// for the hosted document object
hr = pWB->get_Document(&pDocDisp);
if (pDocDisp)
{
VARIANT v;
VariantInit(&v);
I????????* pDoc = NULL; // Which Interface should I use here???
hr = pDocDisp->QueryInterface(IID_????????, reinterpret_cast<void
**>(&pDoc));
if (pDoc)
{
// do stuff
}