Storing folder objects

Aug 6, 2011 at 12:08 AM

Another question about folders...

Is there a way that I can store all the folder objects that I have obtained
by iterating the folder hierarchy, and re-use them?  The purpose would
be to make a simple UI that presents a list of folders, allows selection
of one by the user, then the program accesses all the messages in that folder.

I have tried something like this (with a lot of code omitted):


pstsdk::folder *global_folder_id[100];
...
global_folder_id[n] = &folder_id; // where folder_id is valid folder object


Although the stored folder object works fine right away, on the next
iteration the stored folder object is no longer valid.  I guess I need a
way to copy it, not store the pointer,  but I can't figure out how to code it.

Thanks for  any help.

 

Coordinator
Aug 6, 2011 at 12:50 AM

folder objects are copyable, so try:

 

 

std::vector<pstsdk::folder> folderlist; // note, no pointer

....

folderlist.push_back(folder);