Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This pointer

Status
Not open for further replies.

terickso

Programmer
Feb 5, 2002
3
US
I am using a ctrlview class to display a control kinda like CTreeView. This is a doc/view and this is used in the view to access the functions of the control view
CCodeMaxCtrl& GetCodeMaxCtrl() const { return *(CCodeMaxCtrl*)this; }
The problem is using this for OnInitUpdate works fine but if I lose the focus and I want to access it later the "this" pointer is pointing at ??. I have tried creating member variables and try to assign the value to it but it will not keep the pointer. How can I get access to this control view.
 
Sounds like the pointer member variable is going out of scope. Try moving it to the Mainframe or Application level.
 
Have you tried to associate a variable with the Class Wizard for your control. The variable would be a member of your parent class object(the view).

This uses DDX/DDV and usually will not give you much of a headache

HTH, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top