Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3044

Loadiing Webbrowser control dynamically

$
0
0
I am developing a WYSIWYG application. While saving it generates an asp code and save as an *.asp file.

Now I have to read the file. IWebBrowser2::Navigate is not working. It treats the file as asp code and gives some error message.

I tried this way:

CComQIPtr<IPersistStream> pPS = pWebBrowser2;//pWebBrowser2 is of type IWebBrowser2
Now I read the file and put the data in Stream Object(IStream* pStm)

But pPS->Load(pStm) returns E_FAIL;

Last I attempted to destroy and create the control dynamically hoping Load will work during the creation process.

I opened CFile object and initialized a pointer to the CFile object as m_pFilePersist.

Now I tried to recreate the control as in the following code:

m_wndControl.CreateControl(m_clsid,_T(""),m_dwStyle,CRect(0,0,100,100),this,1,m_pFilePersist,NULL,m_bstrLicKey)

But again inside the MFC code Load is returning E_FAIL!

Now what to do? Please help me.

Viewing all articles
Browse latest Browse all 3044

Trending Articles