Hi , I posted a question earlier about executing a script from a BHO in Vista. I am beginning to think that is not possible to create a script element, insert it in an HTML document and execute it within Vista. It seems no matter what I do the script element is not accessable. Is this true or am I missing a step for Vista. Thanks, Tom
Tom a écrit : > Hi , > > I posted a question earlier about executing a script from a BHO in Vista. I > am beginning to think that is not possible to create a script element, > insert it in an HTML document and execute it within Vista. It seems no > matter what I do the script element is not accessable. Is this true or am I > missing a step for Vista. > > Thanks, > Tom > > This is possible : 1/ Get document element (IHTMLDocument2) 2/ Create a script element pDoc->createElement 3/ Get first child of the body element (get_firstChild) 4/ insert your script element (pNode->insertBefore) The script element I am inserting has a src="http://...". I never tried with inline script data. Do not use "appendChild" method from the body element, this does not work (see http://channel9.msdn.com/wiki/default.aspx/Channel9.InternetExplorerProgrammingBugs) Hope this helps. -- Best Regards / Cordialement ==================== Jean-Fabrice Rabaute CORE SERVICES :: Software/Web development & Consulting services http://www.debugbar.com : The most advanced WEB development tool for Internet Explorer http://www.core-services.fr - {Enjoy the future today}
Thank you for your input Jean-Fabrice. The story gets even more cloudy. It turns out that my BHO is working on Vista Ultimate and Vista Enterprise. BUT it is not working on the Vista Business machine that I have. It happens that the Vista Business machine is a development machine and I do have VS 2005 SP1 on it. The other variable is the Business Vista machine has Windows Live One running also. BTW - I am using AppendChild - I will try to modfiy that section of code to see if that makes any difference. Thanks again for your input. It is greatly appreciated. "Jean-Fabrice RABAUTE" wrote in message news:47e159a6$0$9454$426a74cc@news.free.fr... > Tom a écrit : >> Hi , >> >> I posted a question earlier about executing a script from a BHO in Vista. >> I am beginning to think that is not possible to create a script element, >> insert it in an HTML document and execute it within Vista. It seems no >> matter what I do the script element is not accessable. Is this true or am >> I missing a step for Vista. >> >> Thanks, >> Tom > > This is possible : > > 1/ Get document element (IHTMLDocument2) > 2/ Create a script element pDoc->createElement > 3/ Get first child of the body element (get_firstChild) > 4/ insert your script element (pNode->insertBefore) > > The script element I am inserting has a src="http://...". I never tried > with inline script data. > > Do not use "appendChild" method from the body element, this does not work > (see > http://channel9.msdn.com/wiki/default.aspx/Channel9.InternetExplorerProgrammingBugs) > > Hope this helps. > > -- > Best Regards / Cordialement > > ==================== > Jean-Fabrice Rabaute > CORE SERVICES :: Software/Web development & Consulting services > > http://www.debugbar.com : The most advanced WEB development tool for > Internet Explorer > http://www.core-services.fr - {Enjoy the future today}