Tim Golden schrieb: > I'm using win32gui.PyGetBufferAddressAndLen to pass the address & length > of a marshalled object as the wparam / lparam of a windows message. > Something like this: > > address, length = \ > win32gui.PyGetBufferAddressAndLen (buffer (marshal.dumps (message)))
I guess that the argument to PyGetBufferAddressAndLen() go out of scope here, so they may already be invalid BEFORE you call PostMessage. > PostMessage (self.hwnd, self.WM_PROGRESS_MESSAGE, length, address) > > where "message" here is actually a unicode object. At the other end, I'm > unpacking the message with PyGetString: > > message = marshal.loads (win32gui.PyGetString (lparam, wparam)) > Since you used PostMessage, the message is simply posted to the thread's message queue. You have no control when it is processed; so I fear you must keep the posted 'object' alive even longer. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32