can't import iewin in Phoenix 3.0.3

Recently, there was a question about Active X windows in Phoenix.
I had a look, and basic support is not too hard.

These demos are working for me now:
(Python 3.4)
ActiveX_PDFWindow.py
ActiveXWrapper_IE.py
ActiveX_IEHtmlWindow.py

In the generated file for Internext Explorer at \site-packages\comtypes\gen I had to comment these lines:
True = 1
False = 0

Building the missing PyAxBaseWindow is out of scope for me, but this
is probably not required any more as the ActiveXCtrl can now be derived from wx.Window.

The MSWTranslateMessage is not functional now. No idea whether this will have any
negative effect. For just embedding a HTML or PDF everything seems fine.

Please find below the differences. If I get some feedback from testers, I would
submit a pull-request for this.

Regards,

Dietmar

···

###################################################################################
wx/lib/activex.py

-class ActiveXCtrl(wx.PyAxBaseWindow):
+class ActiveXCtrl(wx.Window):

- hwnd = user32.CreateWindowExA(0, "AtlAxWin", axID,
+ hwnd = user32.CreateWindowExA(0, b"AtlAxWin", axID.encode("ASCII"),

- # Turn the window handle into a wx.Window and set this object to be that window
- win = wx.PyAxBaseWindow_FromHWND(parent, hwnd)
- self.PostCreate(win)
+ wx.Window.__init__(self, parent, wxid, pos, size, style, name)
+ self.AssociateHandle(hwnd)

###################################################################################
wx/lib/activexwrapper.py

- import new
- classObj = new.classobj(className, baseClasses, classDict)
+ classObj = type(className, baseClasses, classDict)

- self.this.own(False) # this should be set in wx.Window.__init__ when it calls _setOORInfo, but...
+ #self.this.own(False) # this should be set in wx.Window.__init__ when it calls _setOORInfo, but...

  def axw__getattr__(self, attr):
      try:
          return pywin.mfc.activex.Control.__getattr__(self, attr)
- except AttributeError:
+ except (AttributeError, win32ui.error):

###################################################################################
demo/ActiveX_IEHtmlWindow.py
          self.location = wx.ComboBox(
- self, -1, "", style=wx.CB_DROPDOWN|wx.PROCESS_ENTER
+ self, -1, "", style=wx.CB_DROPDOWN|wx.TE_PROCESS_ENTER
                              )