|
-
April 26th, 1999, 01:16 AM
#1
STL and MFC
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.
-
April 26th, 1999, 04:29 AM
#2
Re: STL and MFC
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
-
April 26th, 1999, 11:51 AM
#3
Re: STL and MFC
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
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
|