Also I assume you use the MFC, ... |
To draw on a button, you mean?
Not necessaily. MFC is a wrapper around the core of the Win32 API (plus other stuff, like the Document-View support). It uses GDI (the Graphics Device Interface) for its drawing. Anything you can do with MFC, you can do using the GDI API directly (sometimes with a bit more effort.)
Windows also supports a number of other drawing mechanisms, all (or at least most) of which are usable by an MFC application (but not directly supported by MFC) or a native Win32 app. For example, GDI+ or Direct2D (from Windows 7 -- Windows 8 includes it as shipped, but Windows 7 requires a platform update)
do you think [MFC is] obsolete and I should learn QT instead? |
When it comes to the choice between MFC and Qt, it's more a question of whether you want to write Windows-specific or cross-platform code. MFC is not dead yet! (See PS)
But MFC is only easy to use with the paid-for editions of Visual Studio. The MFC headers and libraries are included in the Windows Driver SDK, so it's possible to build MFC apps with the express editions -- or with g++, etc, but not the MFC tools/wizards which make it simpler to handle all the required boiler plate code.
(The merits of the different cross-platform GUI toolkits have been discussed in a number of cplusplus.com threads -- search this site for more info.)
Also note that a lot of Win32 GUIs these days are written using the Windows Presentation Foundation (WPF). This is .NET so must be used from a managed language like C# or C++/CLI, rather then (native) C++.
The current stats for job ads (in the UK, looking at the last 3 Months) is:
Desc Rank Rank Avg Salary Matching Jobs
Change Salary Change Jobs Found
--------------------------------------------------------------
WPF 99 +11 £42,500 +6.25% 2955 (2.734%) Jobs (362)
MFC 637 -34 £37,500 0 226 (0.209%) Jobs ( 35)
Qt 686 +48 £37,500 -6.25% 176 (0.163%) Jobs ( 32) |
From: IT Jobs Watch, Tracking the IT Job Market
http://www.itjobswatch.co.uk/
Andy
PS As far as Microsoft are concerned, both GDI and GDI+ are legacy.
Legacy Graphics
http://msdn.microsoft.com/en-us/library/windows/desktop/hh309470%28v=vs.85%29.aspx
But Direct2D is only available from Windows 7 and there is not only a lot of pre-existing MFC code out there, but companies still want to write code to support pre-Windows 7 computers (support for Windows XP is ending on April 8, 2014; for Windows Vista it's April 11, 2017.)
Windows lifecycle fact sheet
http://windows.microsoft.com/en-GB/windows/products/lifecycle
GDI
http://msdn.microsoft.com/en-us/library/windows/desktop/dd145203%28v=vs.85%29.aspx
GDI+
http://msdn.microsoft.com/en-us/library/windows/desktop/ms533798%28v=vs.85%29.aspx
Direct2D
http://msdn.microsoft.com/en-us/library/windows/desktop/dd370990%28v=vs.85%29.aspx
MFC Direct2D Hello World sample
http://code.msdn.microsoft.com/windowsdesktop/MFC-Direct2D-Hello-World-9aa6ae00
Windows Presentation Foundation
http://msdn.microsoft.com/en-us//library/ms754130.aspx