Re: Pls Help with empty Print Preview
From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 02/25/05
- Next message: Igor Tandetnik: "Re: IPersistStreamInit to Append Text"
- Previous message: Igor Tandetnik: "Re: All behavior about the keydown/keyup not work!"
- In reply to: Peter Carlson: "Re: Pls Help with empty Print Preview"
- Next in thread: Peter Carlson: "Re: Pls Help with empty Print Preview"
- Reply: Peter Carlson: "Re: Pls Help with empty Print Preview"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 18:37:30 -0500
"Peter Carlson" <peter@__N.O.S.P.A.M__howudodat.com> wrote in message
news:%23HTZ8p2GFHA.2804@TK2MSFTNGP10.phx.gbl
> After the document is loaded we execute some JS to finish any last
> minute changes in the html (ie set the default date). If I use
> document->write then I can InvokeScript, if I use the Stream I can't
> - it cant find the script...GetIDOfName cant find the javascript
> function, however, view source shows it's there. I have checked
> both calling Invoke...from OnNavComplete and from a handler for
> window.external.onLoad (which is called in ondocumentready).
Did you try handling DocumentComplete event?
> Below
> is the InvokeScript Call:
>
> HRESULT InvokeScript(LPCOLESTR lpszName, VARIANT* pvarParam1 = NULL,
> VARIANT* pvarRet = NULL) {
> CComPtr<IHTMLDocument2> pDocument; m_pBrowser->get_Document(
> (LPDISPATCH *) &pDocument );
You can't do this. get_Document returns IDispatch pointer. You store it
in an IHTMLDocument2 pointer. This amounts to downcasting from base to
derived interface, which is illegal in COM. You have to use
QueryInterface to navigate between interfaces. The only exception is
going from derived to base interface, but not the other way round.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
- Next message: Igor Tandetnik: "Re: IPersistStreamInit to Append Text"
- Previous message: Igor Tandetnik: "Re: All behavior about the keydown/keyup not work!"
- In reply to: Peter Carlson: "Re: Pls Help with empty Print Preview"
- Next in thread: Peter Carlson: "Re: Pls Help with empty Print Preview"
- Reply: Peter Carlson: "Re: Pls Help with empty Print Preview"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|