Thanks for the tip, venster not only has a neat way to resolve this issue, but plenty of other really useful things (lists of windows constants and other stuff that take time to assemble).
On Jan 13, 2008 4:03 AM, Thomas Heller <[EMAIL PROTECTED]> wrote: > Henry Baxter schrieb: > > Problem solved! > > > > I was using ctypes.byref to pass a reference to the window class, but > before > > calling CreateWindow the window class in question went out of scope and > was > > destroyed. > > > > I'm worried this type of problem will happen more often, but I'm not > sure > > how to stop it...suggestions welcome! > > I guess the important thing that needs to be kept alive is the > ctypes-pointer > to your WindowProc. If the window class keeps a reference to the > WindowProc > you could attach the window class to the Python class that implements the > window. > Or you keep it in a global variable, it depends on how your code is > structured. > > You could also look into the venster code (google for it) for ideas. > > Thomas > > _______________________________________________ > python-win32 mailing list > python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 > -- Henry
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32