Author Topic: MSHTML - use it over and over?  (Read 12523 times)

0 Members and 1 Guest are viewing this topic.

Offline Edwin Knoppert

  • Sr. Member
  • ****
  • Posts: 254
  • User-Rate: +11/-4
  • Gender: Male
    • Hellobasic.com
Re: MSHTML - use it over and over?
« Reply #15 on: September 04, 2011, 11:36:03 PM »
When late bound it works fine but i let's forget that for a moment.
I really really tried everything via atl, even your includes and interfaces.
There really may be something different about the dispatch (oWB).
Can you please check with MSHTML code on ATL?
Like i said, using plain html it always worked fine.

Edit:
Goal is a reference to the document, i tried the interfaces because late binding also didn't work, i don't want the interfaces if not needed, just the document dispatch.
« Last Edit: September 04, 2011, 11:38:09 PM by Edwin Knoppert »

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2518
  • User-Rate: +209/-0
  • Gender: Male
Re: MSHTML - use it over and over?
« Reply #16 on: September 05, 2011, 12:03:39 AM »
I really don't understand what you mean with MSHTML code and plain html.

I don't have anything that uses ATL since I wrote my OLE container, and much less using OBJECT CALL, that I always have disliked deeply. Write a compilable example and I will look at it.

Offline Edwin Knoppert

  • Sr. Member
  • ****
  • Posts: 254
  • User-Rate: +11/-4
  • Gender: Male
    • Hellobasic.com
Re: MSHTML - use it over and over?
« Reply #17 on: September 07, 2011, 08:07:43 PM »
I am using MSHTML to initialize the webcontrol *instead* of using about:blank.
AB requires 'doevents' to complete while MSHTML seems not.
While at first a document for these may not be the same, not sure, but i accomplished this fine using OLECON code but not with atl.
When the MSHTML initializes the webcontrol it was ready to obtain the document object right away and i could then write ordinary html to it (without the MSHTML/xml stuff up front).
So in fact i am trying to get me a document handle from the MSHTML container.
In ATL this keeps failing, i now have an ATL fragment of yours where i have made several kind of attempts to get me a document handle.
Maybe i should abandon this anyway, the document may not be of the same breed??

Anyway, i do have the atl project, i could pm it if you think it's still a valid attempt?


Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2518
  • User-Rate: +209/-0
  • Gender: Male
Re: MSHTML - use it over and over?
« Reply #18 on: September 07, 2011, 09:10:20 PM »
You can't get a reference to the document until it has been fully loaded. Attempting to do it will result in a null reference.

If you use my OLE container and the AddWebBrowserControl method of my CWindow class then you don't need to navigate to about:blank and pump windows events because the method does it for you, not because it is not needed.

Offline Edwin Knoppert

  • Sr. Member
  • ****
  • Posts: 254
  • User-Rate: +11/-4
  • Gender: Male
    • Hellobasic.com
Re: MSHTML - use it over and over?
« Reply #19 on: September 07, 2011, 09:53:56 PM »
Sigh..., now i see..

Offline Edwin Knoppert

  • Sr. Member
  • ****
  • Posts: 254
  • User-Rate: +11/-4
  • Gender: Male
    • Hellobasic.com
Re: MSHTML - use it over and over?
« Reply #20 on: September 07, 2011, 10:45:30 PM »
Call me persistant..., i have the idea of handling the messages to the windows i have listed via the messagepump:
Code: [Select]
Internet Explorer_Hidden
Internet Explorer_Hidden
Shell Embedding
Button
Button
Shell DocObject View
Internet Explorer_Server

I mean that i could simply prevent the messages for other parts of the program by not handling these messages.
In fact that's what i wanted in the first place, no intervening during the load of a webcontrol.
I am not sure it's allowed to post pone certain messages and allow the WC's messages, maybe the messagepump get's mixed up.. (i don't think so)
Disabling a form is very bad.., later :)