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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubclassDlgItem Problems...

Status
Not open for further replies.

rdalton

Programmer
Dec 5, 2002
24
US
I'm using the SDI framework in my application. I just added a customized treeview object to a couple of my FormViews. The object needs to call the SubclassDlgItem function upon initialization, but If I try to open a file or start a new file, I get an assert failed message calling CWND::Attach(...). Anyone have any ideas. Thanks.
 
Perhaps if you add a small code sample - your post is very abstract and in it's current form, begs the possibility of a lost "this", considering you are speaking of three objects - FormView, TreeView as a child of FormView and an open file.

For example, are you evaluating TreeView from "this" file when it's actually part of "FormView"?

Other off-the-wall possibilities: Is your openning file destroying the form, without explicitly destroying your TreeView? Is the openning file closing the TreeView, but not the parent form, leaving the form to choke while trying to destroy the TreeView prior to destroying itself?

Good luck,
Gary Allen
 
I've solved the problem by using a new boolean variable that becomes true on the very first call to OnInitialUpdate(). Then using an if statement, the SubclassDlgItem code is passed over every other time the function is called. The problem was due to multiple calls to SubclassDlgItem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top