problem getting IWebBrowser2 interface from HTML control

Hi,

I have a html control created with WC_HTML classname. I'm trying to get the IWebBrowser2 interface from the code below.

IDispatch *idp = NULL;
IWebBrowser2 *pWB2 = NULL;

SendMessage(hHTML, DTM_BROWSERDISPATCH, 0, (LPARAM)&idp);
idp->QueryInterface(IID_IWebBrowser2, (void **)&pWB2);

I can get the IDispatch but pWB2 is always NULL.

Anyone know how to solve this problem

I'm going to load a html file from the disk to the html control and the html file has a few external links to some websites. I want my html control to load the external link when user press the external link instead of popup up an instance of PIE.

Any help or idea is appreciated.

thanks in advance



Answer this question

problem getting IWebBrowser2 interface from HTML control

  • Rapier685

    I found a much simple solution for my problem, by using DTM_NAVIGATE and passing the "file://filename.htm" solved my provblem. However I would like to know why the QueryInterface above doesn't works.
  • problem getting IWebBrowser2 interface from HTML control