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 [email protected] http://mail.python.org/mailman/listinfo/python-win32
