Re: Manipulating frame names of CHtmlView windows.

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 09/22/04


Date: Wed, 22 Sep 2004 10:00:55 -0400


"Paavo Helde" <paavo@ebi.ee> wrote in message
news:a5df4b39.0409220447.c9ae7d7@posting.google.com
> I have a MFC app with several view windows derived from CHtmlView, of
> several different C++ classes. I would like to have some of them be
> named frame targets, so that the <a href=... frame=somename> would be
> correctly redirected to the appropriate view. The targeting topics
> have been discussed several times in this ng, but I have yet to find a
> proper solution.

That would be <a href=... target=somename>

I suspect the "right" solution is to implement ITargetFrame, which has a
promising-looking FindFrame method. This interface is virtually
undocumented, I have no idea when and how the browser uses it and how to
properly implement it. All I know is that WebBrowser control queries for
it repeatedly, using IServiceProvider::QueryService off the client site
pointer.

Be aware that if you actually assign the names to your browser instances
(IHTMLWindow2::put_name) and let them register themselves with the
system (RegisterAsBrowser = true), then targets will automatically find
them. Such a registration is system-wide though, so if for example there
are two instances of your app running, it is possible that links clicked
in one instance would navigate browsers in the other.

> However, the final obstacle is that the view type is not correct! In
> OnNewWindow2() I don't know which class' object I have to create, and
> the object dynamic type cannot be changed later, at least not by legal
> means.

I don't understand what you are talking about here. You always create
WebBrowser object in response to NewWindow2. Am I missing something?

-- 
With best wishes,
    Igor Tandetnik
"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage


Relevant Pages

  • Re: Ordering from Tower Japan
    ... Enter www.towerrecords.co.jp in your browser. ... Click on Site Map. ... The Site Map will display with some additional English. ... New Register is for 1st-time customers. ...
    (rec.music.classical.recordings)
  • Re: Ordering from Tower Japan
    ... Enter www.towerrecords.co.jp in your browser. ... The Site Map will display with some additional English. ... New Register is for 1st-time customers. ... Mendelssohn Elijah or your Die Walpurnacht disc. ...
    (rec.music.classical.recordings)
  • Re: Ordering from Tower Japan
    ... Enter www.towerrecords.co.jp in your browser. ... The Site Map will display with some additional English. ... New Register is for 1st-time customers. ... Alan Prichard ...
    (rec.music.classical.recordings)
  • Re: Ordering from Tower Japan
    ... Enter www.towerrecords.co.jp in your browser. ... The Site Map will display with some additional English. ... New Register is for 1st-time customers. ... BTW Translate Page to English does not work on the Registration Page. ...
    (rec.music.classical.recordings)
  • Re: Register Message between MFC and Win32 SDK Application
    ... > in MFC app i registered one Message and broadcast it to all windows ... > and Colse Child Should close 2.exe ... > How can i register an Message that should be unique!.... ... The 'parent' process could pass an hWnd on the command line to the child ...
    (microsoft.public.vc.language)