Making sense of WTL, ATL, MFC
As a follow-up to my previous post about having too much free time on my hands while I look over a couple of unix machines, I decided to get myself proficient on Win32 C++ programming.
I began to investigate and I found 3 basic libraries that seem to do what I want, all from Microsoft. MFC, ATL and WTL.
What are the main diferences between them? Which is more used for Windows development, and which should I use?
I've done C++ development in Unix, no Windows GUI stuff, so please bear with me.
RP
Thursday, May 20, 2004
Can anything be achieved on the web without GOOGLE :-)
Anyway, the answer can be stated in one sentence as follows:
http://www.google.com/search?q=MFC%2C+ATL+and+WTL&ie=UTF-8&hl=en&meta=
LOL :)
The One You Loved (TOYL)
Thursday, May 20, 2004
MFC has better support for full featured windows applications than ATL. WTL was designed as an add-on to ATL to provide better support for developing windows applications. IIRC, COM support was added after the initial release of MFC but was designed from the start in ATL. WTL isn't officially supported by Microsoft and was recently open-sourced (or whatever the Microsoft equivalent is).
http://www.codeproject.com/wtl/ & http://www.codeproject.com/atl/ are good references for learning about ATL & WTL.
You can always use smart COM pointers from ATL in your MFC projects.
Semi-Anonymous Coward
Thursday, May 20, 2004
MFC is a framework for creating Windows apps.
ATL is a framework for creating COM objects.
WTL is a framework for creating Windows apps based on heavy use of templates and ATL.
MFC is quite long in the tooth now but still in more demand than WTL, WTL was never official so not used very much although I believe it is used internally in MS quite a lot.
Having said all that if you haven't done any Windows GUI programming I'd start by learning the Win32 api before going on to one of these frameworks.
Tony Edgecombe
Thursday, May 20, 2004
My advise would bed learn the .NET FrameWork and forget ATL MFT WTL
Gollum
Thursday, May 20, 2004
If you're any good, you use Win32 directly and don't bother about libraries. The exception is if you're doing COM objects, when ATL is the go.
MFC is for CS students who were taught programming at university by lecturers who only learnt in from a book themselves.
WTL is waste of space.
.
Thursday, May 20, 2004
I've tried a couple of different frameworks, and I've found ATL/WTL to be the best. It's clean, efficient, not too far removed from the Win32 API, and you don't use stupid wizards. WTL is not documented well, but it's easy to use. Much nicer than MFC.
sid6581
Thursday, May 20, 2004
Has anyone here written commercial software in naked Win32 API?
Alex
Thursday, May 20, 2004
My advice: learn either MFC or .NET, depending on your goal. If you want to do "real" app development or intend to leverage this into a Windows dev job, start with MFC. If your goal is to create your own random apps for the heck of it, .NET might be the way to go. .NET will be mainstream in 2007 when "Longhorn" is released. But, MFC will still be around and will still be viable for a long time. I think Longhorn will have a WOW layer so that win32 and MFC apps will continue to work in perpetuity. So, spending 3-6 months now dorking around with MFC will not be wasted time, IMHO.
"." said:
> MFC is for CS students who were taught
> programming at university by lecturers
> who only learnt in from a book themselves.
This is a bogus statement. I work for a large ISV who publishes both Windows and unix software. The majority of our GUIs are written in MFC. This is true for other friends and associates who work for other ISVs. Sometime it might be handy to write to the straight SDK--you will get smaller EXE sizes if you do this. You may see large SDK apps in the real world where said app was ported from win3.1 or derived from a platform SDK sample. But, MFC manages to make Windows coding more civilized than the straight SDK without compromising your morals too much. A pragmatic choice, in other words.
¬
Thursday, May 20, 2004
Alex wrote: "Has anyone here written commercial software in naked Win32 API?"
I've worked on projects that had significant portions written in the naked Win32 API -- all of the old portions -- and had to make extensive changes to those portions. It was actually pretty simple to work with.
Gustavo
Thursday, May 20, 2004
You might like to look at www.wxwidgets.org it's cross platform win/unix/mac and is very like MFC.
Theres also a python version if you want a civilised language ;-)
Martin Beckett
Thursday, May 20, 2004
WTL is basically MFC lite. We transitioned our core product from MFC to WTL about four years ago (back when it was mostly an undocumented .h file), and found it wasn't hard to learn and significantly reduced code bloat and DLL problems, and was easier to learn for new programmers.
I'd say if you're absolutely intent on doing your GUI in straight C++ and just need a basic window with a menu, toolbar and dialogs, use WTL (latest version 7.0) because it keeps things simple and you have all the source, as well as basic utilility classes like CString and CArray. (However, it doesn't have some of the fancier MFC internet utility classes, so that may be another consideration.)
Ron
Thursday, May 20, 2004
A correction to the last post: The latest version of WTL is 7.1, not 7.0. Otherwise I agree, WTL is the way to go. I use it for all my applications. (And yes, they are commercial.)
As for internet classes, ATL 7.x has lots of useful stuff now. HTTP request classes, SMTP classes, etc.
sid6581
Thursday, May 20, 2004
Actually now WTL 7.5 is the newest version, and it's open sourced at sourceforge - do a google for it.
Mike Diack
Wednesday, June 23, 2004
Recent Topics
Fog Creek Home
|