yrs90
2005-04-19 05:18:47 UTC
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]
-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
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]
-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728