Hi.
I have no Idea about COM, but while i was reading your Patch to learn, I do not understand this pair:
+#define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
+#undef HTMLWINDOW_THIS
Did you mean
+#undef HTMLWINDOW2_THIS
here?