[litwindow-users] Using aggregate/accessors
Status: Alpha
Brought to you by:
hajokirchhoff
From: yrs90 <yr...@ya...> - 2005-04-19 05:19:05
|
On accessing items: I tried the following code. Too bad, I can't create a debug build and use a debugger. wxListCtrl *pList = wxDynamicCast(event.GetEventObject(), wxListCtrl); aggregate ag(make_aggregate(*pList)); accessor ac(ag["Items"]); if (ac.is_valid() && ac.is_container()) { container c = ac.get_container(); // yeah, it worked... etc. } else if(ac.is_valid() && ac.is_aggregate()) { wxMessageBox("is an aggregate"); } else if(ac.is_valid()) { wxMessageBox("valid but not a container"); } else { wxMessageBox("not valid"); } This code returns 'valid but not a container'. Before I put the is_container() check in, it generated a runtime error. In a separate problem, I added a constructor/destructor to an otherwise unchanged class that I pass to the framework and suddenly I started getting runtime access violations. Is there some type of change to the ADAPTER declaration required when there is a constructor in the class? I'll send additional details if the answer solution isn't immediately apparent. Best regards, Joel --- [This E-mail scanned for viruses by Declude Virus] |