OCX and PythonWin....

Bruce Dodson bruce_dodson at bigfoot.com
Sat Aug 14 05:10:39 EDT 1999


On a similar subject.  I was experimenting with MapObjects (an ActiveX
control) and PythonWin.  It seems that every time I load it, PythonWin
crashes on exit (access violation or something).  I tried generating a quick
AppWizard test in VC++, and had no such problems there.  Also no problems in
VB, of course.

My application follows the Internet Explorer example in pywin/demos/ocx.
That example runs fine, but not with MapObjects.  Is there something that
needs to be done to tell pythonwin that this object should be torn down
after its window is closed?  An explicit DestroyWindow didn't help.  I might
try putting the control in a dialog resource and launching it into a
CFormView to do the doc/view thing and perhaps get better integrated with
MFC, but I'd really rather not.  Can anyone offer some words of wisdom?
(btw Mark if you're listening, there's a spot reserved on my bookshelf for
your upcoming Python/Win32 book.)

There is some benefit to this pain.  I am slowly coming to grips with the
way PythonWin wraps MFC.  A light turned on as I was writing this and
realized why the docs talk about PyCMDIChildWnd while the examples derive
from things like MDIChildWnd, why the latter isn't mentioned in the help
file whereas the former can't be found in the object browser.  But it's
6:00am.  After a good morning's sleep I will probably have forgotten what I
learned. :-)





More information about the Python-list mailing list