ChtmlView::OnNewWindow2()

ChtmlView::OnNewWindow2()

Post by Chri » Thu, 03 Aug 2000 04:00:00



ChtmlView::OnNewWindow2()
is there a way to impliment something like what this does only for internet
explorer instead of your own app..
like connecting to an instance of internet explorer and recieving this even
(callback function i would guess)....
 
 
 

1. OnNewWindow2 event

Hello,
I am using a dispatch map and AfxConnectionAdvise

         if (!AfxConnectionAdvise(spBrowser,
DIID_DWebBrowserEvents2,g_ieEventSink->GetInterface
(&IID_IUnknown), TRUE, &cookie)) return false;

with the enumeration from IShellWindowsPtr to connect my
event sink to all instances of IE, and I am trying to get
the URL from the "OnNewWindow2(LPDIPSATCH* ppDisp, BOOL
*Cacnel)" event.  This is what I have, but it keeps
failing on calling get_LocationURL.  Any help is really
appreciated!

void CIEEvents::OnNewWindow2(LPDISPATCH* ppDisp, BOOL*
Cancel)
{
// failing on get_LocationURL
IWebBroser2* pIE;

         HRESULT hr = CoCreateInstance
(CLSID_InternetExplorer NULL,CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2,(void**)*&pIE);

    if (hr == S_OK)
        *ppDisp = (IDispatch*)m_pIE;

        BSTR url;      
        dynamic_cast<IWebBrowser2*>(*ppDisp)-
    AfxMessageBox(_com_util::ConvertBSTRToString(url));

Charles

2. 16 bit

3. HTML source code from CHtmlView

4. question about Smartsuite

5. CHtmlView Class and CreateWindowEx

6. Digital flat panel problem

7. CHtmlView question

8. BX24-AHT features

9. CHtmlView warnings

10. CHtmlView Class

11. CHtmlView Copy question

12. HTML resources and CHtmlView

13. How to programmaticaly set the text size for a CHtmlView class