[python-win32] Python embedded in an MFC app question

Paul Weimer Paul.Weimer at harlandfs.com
Tue May 10 07:12:55 CEST 2005


I have an MFC app that uses Python. All is working well but I was asked to put in an enhancement whose behavior has me stumped.
We use the login dialog that lives in pywin\dialogs and have never had a problem. My users want the cursor to auto tab to the password control after a specified number of characters are entered. I made a copy of the script, and added:
 
self.userIDCtl = self.GetDlgItem(win32ui.IDC_EDIT1)
self.passwordCtl = self.GetDlgItem(win32ui.IDC_EDIT2)
# Set a handler so that any keystrokes entered in the userid edit control will be processed in OnUserIDKeyDown
self.userIDCtl.HookAllKeyStrokes(self.OnUserIDKeyDown)
 
along with OnUserIDKeyDown(self, std).
 
Now here's the problem: it works fine when run in PythonWin and when I run the debug version of my MFC app with the non-debug python22.dll but when I run the release version of my app the handler OnUserIDKeyDown(self, std) never gets called.
 
My suspicion is message pump confusion. Does anyone have any ideas?
 
Thanks
Paul
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20050509/87989fb1/attachment.htm


More information about the Python-win32 mailing list