Sophie
April 9th, 1999, 11:14 AM
Hello, can someone explain to me why (*pSession) is not the right way to pass my whole Session.
Thank You
static void DoEnumSession( CTreeCtrl &ctlTree, HTREEITEM item, const vector<Session> &sessionToDelete)
{
Session *pSession= (Session *) ctlTree.GetItemData( item);
if( pSession != NULL) {
sessionToDelete.push_back( *pSession);
}
else{
HTREEITEM childItem= ctlTree.GetChildItem( item);
while( childItem != NULL) {
DoEnumSession( ctlTree, childItem, sessionToDelete);
childItem= ctlTree.GetNextSiblingItem( childItem);
}
}
}
Error I get:
K:\projet2\VRUtilities\VRUtilitiesTree.cpp(326) : error C2662: 'push_back' : cannot convert 'this' pointer from 'const class std::vector<class Session,class std::allocator<class Session> >' to 'class std::vector<class Session,class std::allocator<cl
*** Session> > &'
Conversion loses qualifiers
Thank You
static void DoEnumSession( CTreeCtrl &ctlTree, HTREEITEM item, const vector<Session> &sessionToDelete)
{
Session *pSession= (Session *) ctlTree.GetItemData( item);
if( pSession != NULL) {
sessionToDelete.push_back( *pSession);
}
else{
HTREEITEM childItem= ctlTree.GetChildItem( item);
while( childItem != NULL) {
DoEnumSession( ctlTree, childItem, sessionToDelete);
childItem= ctlTree.GetNextSiblingItem( childItem);
}
}
}
Error I get:
K:\projet2\VRUtilities\VRUtilitiesTree.cpp(326) : error C2662: 'push_back' : cannot convert 'this' pointer from 'const class std::vector<class Session,class std::allocator<class Session> >' to 'class std::vector<class Session,class std::allocator<cl
*** Session> > &'
Conversion loses qualifiers