Topic: STL and MFC
Author: Stefan Franke <stefan-franke@primus-online.de>
Date: 1998/11/24 Raw View
Ahn Ki-yung wrote:
> I was stuck working a MFC App project with VC++6.0.
> I tried to declare STL Containers (list, set, map, etc) as a meber
> variable of
> MFC class or General class(my own defined class), but it
> didn't work. It didn't make error( while bunch of warnings which
> always comes out when using STL in VC++ ), but when I execute the
> exe file there comes an error message box that says it couldn't
> access the momory. I first that that i had made a mistake but
> when I declared it as a global variable it worked so well. (still bunch
> of warnings)
> I was so stunned by the thought that why it cannot be declared as a
> member variable
> while it can be declared as a global variable.
> MS was too far from Standard C++;
> This was only my humilating experence. Intorductory was so long. hmm.
> I saw another amazing fact with the project files.
> The MFC CSting class was very well defined. It had all the comparison
> opreators
> ( hmm I wonder this if english is right? "comparison operator" )
> so I could make map<CString> . But next I tried to make set<CString> and
> it made
> an error. I thought data types which could form maps can all form sets,
> because
> I thought set is a map which type of Key and the value are the same. Am
> I wrong ?
> Is there more conditions to make a set which is not a condition of
> making a map ?
> Or is this another problem of VC++ compiler or MFC library ? Please tell
> me.
It's perhaps e problem with the allocators you use!
-> Try malloc_alloc to be sure, it's not a problem with the allocators.
It's not only MS which is "far from the standard".
Some (most) STL implementations are "far from the real world": Most don't
support distributed/shared objects (allocated here, freed elsewhere...)
Stefan
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Ahn Ki-yung <kyagrd@haje5.kaist.ac.kr>
Date: 1998/11/16 Raw View
I was stuck working a MFC App project with VC++6.0.
I tried to declare STL Containers (list, set, map, etc) as a meber
variable of
MFC class or General class(my own defined class), but it
didn't work. It didn't make error( while bunch of warnings which
always comes out when using STL in VC++ ), but when I execute the
exe file there comes an error message box that says it couldn't
access the momory. I first that that i had made a mistake but
when I declared it as a global variable it worked so well. (still bunch
of warnings)
I was so stunned by the thought that why it cannot be declared as a
member variable
while it can be declared as a global variable.
MS was too far from Standard C++;
This was only my humilating experence. Intorductory was so long. hmm.
I saw another amazing fact with the project files.
The MFC CSting class was very well defined. It had all the comparison
opreators
( hmm I wonder this if english is right? "comparison operator" )
so I could make map<CString> . But next I tried to make set<CString> and
it made
an error. I thought data types which could form maps can all form sets,
because
I thought set is a map which type of Key and the value are the same. Am
I wrong ?
Is there more conditions to make a set which is not a condition of
making a map ?
Or is this another problem of VC++ compiler or MFC library ? Please tell
me.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]