On February 13, 2004 12:35 pm, Mike McCormack wrote:
OK, this time I've done it the right way, and it at least works for one or two apps, with a screen shot to prove it.
Very cool indeed Mike! One thing that I've noticed is that the code uses a lot of Mozilla dependent names, but the only thing that's actually Mozilla specific is the CLSID. Shouldn't we just read that info from the registry (from some sort of HtmlControl key), so that people can experiment with other things as well (e.g. IE) just by changing the configuration?
Another thing:
+ if( !SHDOCVW_GetMozctlPath( szPath, sizeof szPath ) )
where szPath is an array of WCHAR, so you pass the size in bytes (sizeof szPath).I hope that's OK (I have to run now, and I don't have time to look up Reg* docu). :)
lør, 14.02.2004 kl. 18.11 skrev Dimitrie O. Paun:
On February 13, 2004 12:35 pm, Mike McCormack wrote:
OK, this time I've done it the right way, and it at least works for one or two apps, with a screen shot to prove it.
Very cool indeed Mike! One thing that I've noticed is that the code uses a lot of Mozilla dependent names, but the only thing that's actually Mozilla specific is the CLSID. Shouldn't we just read that info from the registry (from some sort of HtmlControl key), so that people can experiment with other things as well (e.g. IE) just by changing the configuration?
Perhaps it would have been useful to be reminded of this earlier, but if what you're trying to do is to let a CoCreateInstance on a particular CLSID (like IE) create an instance of a different but compatible CLSID (like Mozilla), you could have just used the CoTreatAsClass() functionality (if someone implemented the necessary CoGetTreatAsClass call in CoGetClassObject, at least).
Ove Kaaven wrote:
Perhaps it would have been useful to be reminded of this earlier, but if what you're trying to do is to let a CoCreateInstance on a particular CLSID (like IE) create an instance of a different but compatible CLSID (like Mozilla), you could have just used the CoTreatAsClass() functionality (if someone implemented the necessary CoGetTreatAsClass call in CoGetClassObject, at least).
That sounds like a nice clean way to do it.
The only advantage I can thing of that my method may offer is that IE will just start working if it installed. Using CoTreatClassAs I presume you'll have to remember to hack the registry to stop Mozilla's Active X control being used in place of IE's... unless ofcourse IE remember to overwrite the registry keys that are used by CoTreatClassAs...
Mike
Hi Dimi,
Dimitrie O. Paun wrote:
Very cool indeed Mike! One thing that I've noticed is that the code uses a lot of Mozilla dependent names, but the only thing that's actually Mozilla specific is the CLSID. Shouldn't we just read that info from the registry (from some sort of HtmlControl key), so that people can experiment with other things as well (e.g. IE) just by changing the configuration?
Well, the way to experiment with IE is to do:
"shdocvw" = "native"
since shdocvw is part of Internet Explorer itself.
Another thing:
+ if( !SHDOCVW_GetMozctlPath( szPath, sizeof szPath ) )
where szPath is an array of WCHAR, so you pass the size in bytes (sizeof szPath).I hope that's OK (I have to run now, and I don't have time to look up Reg* docu). :)
I'm pretty sure that RegQueryValueEx takes the size of the buffer in bytes, because it's not necessarily a WCHAR string that is being queried. My usage is a little non-stardard, and perhaps deserves a comment, but as Australians say : "she'll be right!".
Now the only thing to do is to somehow fix the mess I've made of mshtml. Perhaps we can get the Mozilla people to create another OLE object that exposes the same interfaces as CLSID_HtmlDocument...
Mike