manuell
manuell

Reputation: 7620

Coding a BHO targeting IE7

Context: after some code modifications, my BHO doesn't work anymore with IE7.

The problem: I use QueryInterface on an IHTMLElement for IHTMLElement5, and result is 0x80004002 (No such interface supported).

I remender that some time ago, the MSDN documentation on Scripting Object Interfaces (MSHTML) would have indicated which version of IE supported each interface. This is no more the case. The IHTMLElement5 documentation says "Windows XP with SP2"... I think it's wrong, but anyway, now to my question:

How to make my Visual Studio 2010 C++ build fail if I want to support IE7 and use IHTMLElement5?

I searched the subject with google and SO, and found that there is a #define, _WIN32_IE that may be used to target a minimal specific IE version. My problem is that it doesn't change anything, all compile fine when I set the macro to _WIN32_IE_IE70

I searched the string '_WIN32_IE' in (in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\mshtml.h) and found no match. Does it means that you can't make the build fail when setting the macro to _WIN32_IE_IE70 and using IHTMLElement5 in the code?

Upvotes: 2

Views: 109

Answers (1)

Eric Brown
Eric Brown

Reputation: 13932

IHTMLElement5 isn't supported on IE 7. It's only supported on IE 8. IE 8 is supported on XP, so the documentation is correct.

Unfortunately, _WIN32_IE isn't terribly useful any more; when Windows and IE were more closely bound, it was somewhat useful, but effectively anything > _WIN32_IE_60 is going to expose all the APIs that would be exposed.

Upvotes: 2

Related Questions