|
-
April 9th, 1999, 11:14 AM
#1
How can I pass my whole session
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
-
April 9th, 1999, 03:22 PM
#2
Re: How can I pass my whole session
Try copying sessionToDelete and performing your operations on the copy. I have had a lot of problems because the compiler does not like you to alter arguments passed as const.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|