Click here to Skip to main content
16,006,845 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: STL vs. MFC Pin
Tim Smith6-Jan-03 9:57
Tim Smith6-Jan-03 9:57 
GeneralRe: STL vs. MFC Pin
lpvoid7-Jan-03 2:52
lpvoid7-Jan-03 2:52 
GeneralRe: STL vs. MFC Pin
valikac6-Jan-03 16:10
valikac6-Jan-03 16:10 
GeneralRe: STL vs. MFC Pin
lpvoid7-Jan-03 3:00
lpvoid7-Jan-03 3:00 
GeneralRe: STL vs. MFC Pin
valikac7-Jan-03 4:43
valikac7-Jan-03 4:43 
GeneralRe: STL vs. MFC Pin
lpvoid7-Jan-03 5:48
lpvoid7-Jan-03 5:48 
GeneralRe: STL vs. MFC Pin
valikac7-Jan-03 9:02
valikac7-Jan-03 9:02 
GeneralRe: STL vs. MFC Pin
User 98858-Jan-03 10:06
User 98858-Jan-03 10:06 
Once you get familiar with STL containers, I guess you would never use MFC containers again. Atleast, that was the case with me.

First of all, generic algorithms exist. As Tim pointed out, they may not give you the best performance possible - but, how many times do you need that performance - I would say a very negligible fraction.

For example, I had a loop that executed 10000 times a second, and had some container operations on it. Using a custom allocator, I was able to speed up the operations dramatically. This shows the flexibility that STL hands you in improving performance of pre-written code. To give another example, the hash_map in the STL that comes with VC7 is highly configurable - including the hash function, where as CMapStringToPtr does not allow me to customize the hash function.

Another thing that I would like to emphasize is the detachment of core logic from UI. I suggest that you never write algorithms and stuff in window classes, rather have a generic class hold the data and multiple inherit the target window from the MFC window class the the generic class that holds the data. This way, you can repalce your windowing with say wxWindows easily because your window classes do not have any core implementation.

Thomas


My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers


modified 29-Aug-18 21:01pm.

GeneralRe: STL vs. MFC Pin
User 98859-Jan-03 2:36
User 98859-Jan-03 2:36 
GeneralRe: STL vs. MFC Pin
Tim Smith9-Jan-03 4:04
Tim Smith9-Jan-03 4:04 
GeneralRe: STL vs. MFC Pin
User 98859-Jan-03 5:12
User 98859-Jan-03 5:12 
GeneralRe: STL vs. MFC Pin
Tim Smith9-Jan-03 15:08
Tim Smith9-Jan-03 15:08 
GeneralRe: STL vs. MFC Pin
lpvoid10-Jan-03 13:45
lpvoid10-Jan-03 13:45 
GeneralRe: STL vs. MFC Pin
lpvoid10-Jan-03 16:48
lpvoid10-Jan-03 16:48 
GeneralHelp with ATL 7.0 Pin
Binky6-Jan-03 8:12
Binky6-Jan-03 8:12 
Generalmap of _variant_t Pin
[James Pullicino]5-Jan-03 21:57
[James Pullicino]5-Jan-03 21:57 
GeneralRe: map of _variant_t Pin
Michael Dunn5-Jan-03 22:14
sitebuilderMichael Dunn5-Jan-03 22:14 
GeneralRe: map of _variant_t Pin
[James Pullicino]5-Jan-03 22:20
[James Pullicino]5-Jan-03 22:20 
GeneralRe: map of _variant_t Pin
Jörgen Sigvardsson17-Jan-03 12:26
Jörgen Sigvardsson17-Jan-03 12:26 
GeneralProblem with WTL Pin
Ph@ntom5-Jan-03 18:43
Ph@ntom5-Jan-03 18:43 
GeneralRe: Problem with WTL Pin
Michael Dunn5-Jan-03 20:40
sitebuilderMichael Dunn5-Jan-03 20:40 
GeneralRe: Problem with WTL Pin
User 98858-Jan-03 10:14
User 98858-Jan-03 10:14 
GeneralWTL: a newbie question Pin
Shah Shehpori5-Jan-03 18:41
sussShah Shehpori5-Jan-03 18:41 
GeneralRe: WTL: a newbie question Pin
Jörgen Sigvardsson17-Jan-03 12:29
Jörgen Sigvardsson17-Jan-03 12:29 
GeneralCRegKey QueryStringValue Pin
rbeckett5-Jan-03 17:01
rbeckett5-Jan-03 17:01 

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.