Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MFC and STL [closed]

Tags:

c++

stl

mfc

Would you mix MFC with STL? Why?

like image 232
Ron Avatar asked Jan 06 '09 09:01

Ron


4 Answers

Sure. Why not?

I use MFC as the presentation layer, even though the structures and classes in the back-end use STL.

like image 96
dalle Avatar answered Sep 28 '22 07:09

dalle


Use STL whenever you can, use MFC when no alternative

like image 38
Patrick Avatar answered Sep 28 '22 05:09

Patrick


I mix them all the time. The only minor PITA was serialization - the MFC containers (CArray, CList, CStringArray, etc.) support CArchive serialization, but when using STL containers you have to roll your own code. In the end I switched to using boost::serialization and dumped the MFC CArchive stuff.

like image 31
Rob Avatar answered Sep 28 '22 06:09

Rob


Yes, I have mixed them before without problems. However, after using MFC for over a decade, I would never consider using it for a new project.

like image 36
Ferruccio Avatar answered Sep 28 '22 07:09

Ferruccio