Click here to Skip to main content
15,902,198 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CList Vs CArray MFC Pin
Kevin McFarlane6-Aug-06 8:50
Kevin McFarlane6-Aug-06 8:50 
GeneralRe: CList Vs CArray MFC [modified] Pin
bob169726-Aug-06 9:27
bob169726-Aug-06 9:27 
GeneralRe: CList Vs CArray MFC Pin
Kevin McFarlane6-Aug-06 9:44
Kevin McFarlane6-Aug-06 9:44 
GeneralRe: CList Vs CArray MFC Pin
Christian Graus6-Aug-06 10:46
protectorChristian Graus6-Aug-06 10:46 
GeneralRe: CList Vs CArray MFC Pin
Zac Howland7-Aug-06 4:11
Zac Howland7-Aug-06 4:11 
GeneralRe: CList Vs CArray MFC Pin
Christian Graus6-Aug-06 10:48
protectorChristian Graus6-Aug-06 10:48 
GeneralRe: CList Vs CArray MFC Pin
Zac Howland7-Aug-06 4:01
Zac Howland7-Aug-06 4:01 
GeneralRe: CList Vs CArray MFC Pin
Christian Graus6-Aug-06 11:01
protectorChristian Graus6-Aug-06 11:01 
bob16972 wrote:
How exactly does STL integrate better into MFC application than it's own CObject aware containers?


It plainly does not. You'd need to write one or two function objects to replace this part of the MFC containers.

bob16972 wrote:
As a novice to STL, I'd love to learn.


While I slept, it became clear that you're trying to bait me, but I'll answer anyhow.

1 - MFC containers are convoluted to access compared to STL.
2 - MFC containers all use different iterators, so to move objects from one type of container to another is a pain
3 - MFC containers do not come with any algorithms such as search, sort, binary_search and random_shuffle
4 - I don't believe that MFC containers have a for_each mechanism that allows to easily write small functions that plug into the containers for reuse of code for common operations
5 - MFC containers were written before STL containers, and were intended to be a stopgap until an STL implimentation became available.
6 - MFC containers are not standard, so if you ever find you're writing a program without MFC, you will be forced to learn STL anyhow.

So, it is better IMO to learn the more powerful and more widely available library, although there's nothing wrong with using MFC containers in the knowledge that you've compared the two options and there are reasons for the choice. In my experience, many people don't even know about STL, and certainly people who ask 'what's the difference between an array and a list' are likely to fall into that category. I use CString all the time, but I would use std::string as a first port of call on my own code, unless I knew that CString did something better.




Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog

GeneralRe: CList Vs CArray MFC Pin
Kevin McFarlane6-Aug-06 23:18
Kevin McFarlane6-Aug-06 23:18 
GeneralRe: CList Vs CArray MFC Pin
Christian Graus6-Aug-06 23:53
protectorChristian Graus6-Aug-06 23:53 
GeneralRe: CList Vs CArray MFC Pin
Zac Howland7-Aug-06 3:56
Zac Howland7-Aug-06 3:56 
GeneralRe: CList Vs CArray MFC Pin
Christian Graus7-Aug-06 10:32
protectorChristian Graus7-Aug-06 10:32 
GeneralRe: CList Vs CArray MFC Pin
Zac Howland7-Aug-06 14:48
Zac Howland7-Aug-06 14:48 
AnswerRe: CList Vs CArray MFC Pin
Hamid_RT6-Aug-06 3:08
Hamid_RT6-Aug-06 3:08 
AnswerRe: CList Vs CArray MFC Pin
David Crow7-Aug-06 3:59
David Crow7-Aug-06 3:59 
Questioncalling another window from dialog box and display data Pin
With_problem5-Aug-06 18:05
With_problem5-Aug-06 18:05 
AnswerRe: calling another window from dialog box and display data Pin
A_Fa5-Aug-06 20:10
A_Fa5-Aug-06 20:10 
GeneralRe: calling another window from dialog box and display data Pin
With_problem6-Aug-06 16:34
With_problem6-Aug-06 16:34 
AnswerRe: calling another window from dialog box and display data Pin
Vipin Aravind6-Aug-06 2:12
Vipin Aravind6-Aug-06 2:12 
GeneralRe: calling another window from dialog box and display data Pin
With_problem6-Aug-06 16:29
With_problem6-Aug-06 16:29 
AnswerRe: calling another window from dialog box and display data Pin
Hamid_RT6-Aug-06 3:04
Hamid_RT6-Aug-06 3:04 
GeneralRe: calling another window from dialog box and display data Pin
With_problem6-Aug-06 16:32
With_problem6-Aug-06 16:32 
GeneralRe: calling another window from dialog box and display data Pin
Kiran Pinjala6-Aug-06 19:12
Kiran Pinjala6-Aug-06 19:12 
GeneralRe: calling another window from dialog box and display data [modified] Pin
With_problem6-Aug-06 19:27
With_problem6-Aug-06 19:27 
GeneralRe: calling another window from dialog box and display data Pin
Hamid_RT6-Aug-06 19:35
Hamid_RT6-Aug-06 19:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.