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).<br><br><div class="gmail_quote">On Jan 13, 2008 4:03 AM, Thomas Heller <
<a href="mailto:theller@ctypes.org">theller@ctypes.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Henry Baxter schrieb:
<br><div class="Ih2E3d">> Problem solved!<br>><br>> I was using ctypes.byref to pass a reference to the window class, but before<br>> calling CreateWindow the window class in question went out of scope and was
<br>> destroyed.<br>><br>> I'm worried this type of problem will happen more often, but I'm not sure<br>> how to stop it...suggestions welcome!<br><br></div>I guess the important thing that needs to be kept alive is the ctypes-pointer
<br>to your WindowProc. If the window class keeps a reference to the WindowProc<br>you could attach the window class to the Python class that implements the window.<br>Or you keep it in a global variable, it depends on how your code is structured.
<br><br>You could also look into the venster code (google for it) for ideas.<br><br>Thomas<br><br>_______________________________________________<br>python-win32 mailing list<br><a href="mailto:python-win32@python.org">python-win32@python.org
</a><br><a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br></blockquote></div><br><br clear="all"><br>-- <br>Henry