Roger Lakner
2005-12-18 01:39:47 UTC
In my CView-derived class in my SDI app, I wish to embed a button. So,
in MyView.h I have:
CButton PassButton;
In MyView.cpp, I create it:
PassButton.Create(_T("Test"), WS_CHILD | WS_VISIBLE |
BS_DEFPUSHBUTTON, CRect(362,441,362+100,441+30), this, ID_PASSBUTTON);
I, of course, have a message map to a function that handles the button
press. Everything works fine, button displays, clicking on the button
starts the expected handler, etc., except that the data associated
with many of my other variables is now garbage. If I comment out the
Create statement -- no problems. Is this a faulty implementation of a
button on my part or a bug in the CButton code or something else? Any
ideas will be greatly appreciated.
I'm using Visual .NET 2003 on XP SP2.
Roger Lakner
in MyView.h I have:
CButton PassButton;
In MyView.cpp, I create it:
PassButton.Create(_T("Test"), WS_CHILD | WS_VISIBLE |
BS_DEFPUSHBUTTON, CRect(362,441,362+100,441+30), this, ID_PASSBUTTON);
I, of course, have a message map to a function that handles the button
press. Everything works fine, button displays, clicking on the button
starts the expected handler, etc., except that the data associated
with many of my other variables is now garbage. If I comment out the
Create statement -- no problems. Is this a faulty implementation of a
button on my part or a bug in the CButton code or something else? Any
ideas will be greatly appreciated.
I'm using Visual .NET 2003 on XP SP2.
Roger Lakner