سؤال

According to my client's demand, I am aiming to write a Internet Explorer BHO which on button click executes my custom Javascript. I have started with this link which contains an example BHO which is inplemented in C++,

http://www.codeproject.com/Articles/37044/Writing-a-BHO-in-Plain-C

But when I try to run it in Visual C++ 2010 Express, it doesnot build. I have these question regarding IE BHO:-

1) On which platform can I build and make changes to the above example code , in VC++ 2010 or Windows 7 SDK?

2) Any other tutorial you can refer me; which can guide me how to make BHO in C++ ?

3) I intend to make a button while using IE BHO, such that whenever it is clicked, my custom javascript is executed. Can anybody give me a general guidance on how to do this?

I have searched alot about this matter on Internet, but it seems that majority of the people are implementing BHO in C#. I am in need of some good suggestions.

هل كانت مفيدة؟

المحلول

First question: You should not ask a question saying "it does not build" and saying nothing about your build problem. Do you want us to download the project and guess what is Ok and what is not depending on VS and OS versions? Update your question with your build problem.

Second question: Use Google: Building Browser Helper Objects with Visual Studio 2005 It's old now, but nothing has really changed since then. Alas, you must have an ATL capable version of VS, and the Express versions are not. Anyway,I very strongly discourage writing a C++ BHO without the help of ATL. You may get the ATL sources by downloading a recent SDK, but you will not have the wizards. If you have a "full" VS2008, it will do the job perfectly well.

Third question: general guidance is the IHTMLWindow2 execScript method

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top