Anyone out thier have any examples of using any of the STL container class inside of the MFC Document View enviroment? any help would be greatly APP.
Printable View
Anyone out thier have any examples of using any of the STL container class inside of the MFC Document View enviroment? any help would be greatly APP.
Hi,
I'm using stl in my document class. My application has project files. In each projectfile I can have multiple source files. The pointers to these source files are stored in a map like this :
#include <string>
#include <map>
typedef std::string cstring;
typedef std::map<cstring, CSourceFile *> SourceFileMap;
In my document class I declare a member like this :
SourceFileMap m_SourceFiles;
Adding a sourcefile to this map is like this :
m_SourceFiles.insert(std::make_pair(sFileName, pSourceFile));;
I use the insert-method instead of the operator[] because the operator[] does a lot of extra object creations and destructions.
A good resource for learning stl is the Thinking in C++ pages on codeguru : http://www.codeguru.com/cpp/tic/index.shtml
Thanks Frank,
I did get a map to store information? ( thanks to your info)
I'm having a little trouble displaying back in the view ?
Thank again for your help