Link to home
Start Free TrialLog in
Avatar of captainkirk
captainkirk

asked on

CFormView class data members getting corrupted

I have a class derived from CFormView which contains instance data such as a pointer to a CStatic which is used to load and display a bitmap and is initialized in OnInitialUpdate(). The problem is, when entering other class member functions, the hWnd of the CStatic* is no longer valid. I have worked around it by using GetDlgItem() every time I want to reference the control. This problem does not occur in CDialog derived classes, just when trying to do the same thing in a CFormView. Is there a special way to treat member data such that it remains stable from member function to member function??
ASKER CERTIFIED SOLUTION
Avatar of mikeblas
mikeblas

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of captainkirk
captainkirk

ASKER

Thank you, Mike --  u r a genius...