Click here to Skip to main content
15,881,172 members
Everything / Desktop Programming / MFC

MFC

MFC

Great Reads

by Hans Dietrich
XQueue implements a shared-memory first-in first-out (FIFO) queue, based on memory-mapped files, that works on all versions of Windows.
by Paul Vickery
Code to add a message bar to virtually any existing Windows control.
by Hans Dietrich
This series of articles is a step-by-step guide to reading files stored in your program's resources. Along the way I will present some non-MFC classes to assist you in reading text, binary, zip, and even encrypted files that have been compiled into your program as resources.
by Paul M Watt
Guide to understanding how to create and use regions with the WIN32 SDK

Latest Articles

by Ștefan-Mihai MOGA
Task Manager shows you the programs, processes, and services that are currently running on your computer. You can use Task Manager to monitor your computer’s performance or to close a program that is not responding.
by Ștefan-Mihai MOGA
This article is about the IntelliFile application which is a free alternative Windows version to Total Commander and uses many components that have been published on CodeProject.
by Ștefan-Mihai MOGA
An alternative Windows version to XML Sitemap online generators
by PJ Arends
An MFC CWnd derived grid of user definable tiles

All Articles

Sort by Score

MFC 

15 Apr 2018 by hofingerandi
Workaround for a bug in the CMFCEditBrowseCtrl that causes heavy flickering (starting with Windows 7)
13 Sep 2013 by Hasan Gurler
Simple DXF reader and viewer supporting the most common AutoCAD entities
10 Jul 2014 by _Flaviu
A small guide to use VTK in MFC
13 Apr 2018 by _Flaviu
A method of how to get rid of "close" menu from multiple CDockablePane panels
25 Jan 2011 by Mukit, Ataul
Create a bitmap from an array of pixels
2 Mar 2016 by Antonio Miras
Programatically set a static IP, subnet mask and gateway to an ethernet network adapter on your local machine
4 Dec 2020 by Eddie Nambulus
CheckBox as an item in CComboBox
4 Mar 2021 by Southmountain
glaux.h header file & glaux.lib can be replaced by freeglut.h & freeglut.lib
21 May 2021 by rev78
Simply bypass the 255 columns in MFC CRecordset
13 Jun 2011 by Mukit, Ataul
Addresses the issue of opening a view in maximized mode the proper way in MFC.
21 Feb 2012 by Jochen Arndt
Information about COleDataSource not contained in the Microsoft documentation or hardly to be found
26 Oct 2017 by Rick York
Something to help compile samples from the VS2010 feature pack
21 Oct 2010 by Aescleal
printf is so 1980s. If you don't want to dig out your shoulder pads and big hair why not go for a more modern C++ approach?Instead of a function try a stream buffer:class message_box_stream_buf : public std::basic_streambuf{ public: message_box_stream_buf( const...
13 Nov 2011 by .dan.g.
Displaying the 'new' Vista/Windows 7 File Dialog in 'old' MFC Apps
8 Dec 2011 by Ștefan-Mihai MOGA
How to get the MAPI server nane
9 Apr 2013 by _Flaviu
Improved Excel class
4 Jul 2020 by Michael Haephrati
How to set write direction and alignment
21 Mar 2022 by Roger65
How to type text into a static control, change the font used and then save it into a bitmap
24 May 2015 by JPhelps
Using CFolderPickerDialog
29 Jan 2024 by Ștefan-Mihai MOGA
How to implement the missing CMFCListView class
25 Jun 2011 by Mukit, Ataul
Link to How to implement a resizable property sheet class that contains a menu bar in Visual C++ 6.0
27 Mar 2013 by Aydin Homay
Minor changes on CGridCtrl 2.27 for compatibility with old version of this control
22 Dec 2014 by TyrWang
Use CResizeWnd as an add-on to any dialog
22 Aug 2015 by Juan AG
Create a dll wich uses MFC statically linked and allow you to call normal methods, static methods and global variables, quick an easy
6 Jul 2011 by Mukit, Ataul
Shows how to enable invoking of the OnUpdateCmdUI(...) in a dialog or property sheet when a menu bar item is pulled down to show popup menu
20 Jul 2011 by Mukit, Ataul
this tip tells about a tool that converts a win32 rc file to XML
30 Oct 2011 by steveb
In UNICODE:CString str = L"Test";std::wstring ws(str);std::string s;s.assign(ws.begin(), ws.end());
26 Jan 2012 by hairy_hats
When linking a mixture of mixed-mode and unmanaged DLLs to an unmanaged C++ executable, the link order can affect how the program runs.
5 Mar 2012 by Mukit, Ataul
This tip shows a very fast algorithm (with some constraints enforced for it to work) to EnsureVisible a row in CGridCtrl by Chris Maunder
30 May 2012 by anscode
This post describes a slider control for C++ which make your application more attractive.
7 May 2013 by Aydin Homay
This tip/trick discusses about hosting a Windows Form user control in an MFC dialog box and View windows.
31 Jul 2013 by Thomas B Dignan
Getting the text of Win32 Error codes for 99% of cases.
11 Oct 2015 by Member 11246861
Wifi communication between RaspberryPi2 and Laptop ASUS: fonts English, Russian.
23 Mar 2016 by _Flaviu
A way to know when a floating CDialogBar is closed
28 Jan 2019 by Roger65
Selected Font name, Point Size and Weight are displayed
15 Sep 2011 by Mukit, Ataul
This tip shows you how to convert the dimension values in the .rc file of a dialog into pixels
15 Sep 2011 by Mukit, Ataul
This is not so much of a trick, just a little tip about how CTRL+I is interpretated in a window
1 Nov 2011 by Kaqkk79
How about this (assuming your project is set to Unicode)?CString strMyString=L"Test string";std::string strMyStdAnsiStr = CStringA(strMyString);
28 Jun 2012 by Binu MD
Change GUI control position with dialog re-size
22 Jan 2013 by kennethman
Hide data inside the zip structure of any zip-based file.
22 Apr 2014 by SaahilPriya
Connect Systems using WMI Services, Remote as well as Local
21 Mar 2015 by SaahilPriya
The sample demonstrates how to count the number of OLE Automation Objects running at a particular time.
30 Nov 2016 by David Wincelberg
Displays a date/time difference as calendar days or 24-hour days and can show hours or minutes for the first 24 hours
13 May 2020 by Apprieu (Apprieu)
How to generate a serial key with Crypto API MFC
4 Feb 2010 by Eugen Podsypalnikov
http://rapidsh...
19 Sep 2010 by Reto70
Protect 'DLL hijacking' in MFC app with MAPI and Microsoft Office
28 Dec 2010 by danielexx
Algorithm C++/MFC
1 Dec 2011 by stonexin
LPSTR WideChar2MBCS( const CString& strCS ){ const UINT wLen = strCS.GetLength() + 1; UINT aLen = WideCharToMultiByte(CP_ACP,0,strCS,wLen,NULL,0,NULL,NULL); LPSTR lpa = new char[aLen]; WideCharToMultiByte(CP_ACP,0,strCS,wLen,lpa,aLen,NULL,NULL); return...
23 Jan 2012 by Roger65
CFileDialog in a Console Application
29 Jan 2013 by Roger65
Find file or use wildcard i.e. dlg*.h, or *.*
30 Aug 2014 by Javad Taheri (drjackool)
How to use read only option in Vista common file dialog
20 Nov 2013 by Richard MacCutchan
Obscure a window or the screen and show a dialog.
7 Apr 2011 by oleg63
CString m_Name;CT2CA pszName(m_Name);std::string m_NameStd(pszName);Works for me everywhere... :)
20 Feb 2024 by Ștefan-Mihai MOGA
A look at the URLDownloadToFile function and architecture of IntelliLink
24 Nov 2013 by SoMad
The example for CStringT::Tokenize() on the MSDN page (and just about everywhere else on the Internet) skips empty tokens. Here is how to use it in order to get empty strings instead of simply skipping those fields.
10 Dec 2011 by Pranit Kothari
If you have chosen Win32 console based application while using New Project Wizard, and later you realize you need to add MFC support, here is a trick.
28 Dec 2014 by Akos Mattiassich
Find a window on the desktop, spy its properties and manipulate it.
8 Oct 2017 by _Flaviu
A memory CTreeCtrl like object, but resident in memory only
9 Mar 2015 by sunhui
Integrate .NET Component to your Native MFC Application at runtime
30 Apr 2014 by Nitesh Kejriwal
Friends, I am planning to write a series of articles on creating menus in different ways and this is the 1st one in the series. This post will explain how to create a simple 2 level menu using HTML and CSS only. We know there are a lot of ways to create a HTML menu …Read more →
2 Apr 2011 by jean Davy
As you use CString, you have access to the CW2A ATL macro, assuming that you work with _UNICODE defined, here it is:CString theCStr;...std::string STDStr( CW2A( theCStr.GetString() ) );which will convert to "system encoding on the user's machine" (thanks Nemanja[^] comment !), if you...
5 Jan 2015 by zdanman
Fully Customizable ProgressBar Control with Percentage shown that changes color as progress covers it
20 Oct 2010 by Ajay Vijayvargiya
Need to Format/sprintf a string before displaying a messagebox? Here is solution!
24 Apr 2010 by Kartik Sura
Introduction...
6 Apr 2013 by ReturnVoid
Working example: OpenGL CDialog Multiple Context
18 Dec 2020 by ferdo
How to compile MFC sources with VS 2019 (for ARM64 too)
26 Jan 2011 by Kyudos
Extracting A Particular Icon From an .ICO Resource
29 Jun 2011 by Mukit, Ataul
Shows how to view the current library link order in a VC project
5 Mar 2014 by rbrunton
Using Windows hooks to capture mouse action.
10 Jun 2020 by fernando amatulli
Polynomial interpolation algorithm from 1 to 9 degree that allow forcing constant term to 0
21 Aug 2017 by Biruk Abebe
How to completely take control of drawing a custom application window including the captionbar, menubar, toolbar, borders and statusbar in MFC Single document interface (SDI) applications using the MfcSkinSDI class.
19 Jun 2012 by Binu MD
Change the default ICON of MFC applications
2 Feb 2011 by Mukit, Ataul
This tip shows the technique of loading a 256 color bitmap into an image list
6 Feb 2012 by Mukit, Ataul
Given a device context, replace a color (clrColorReplace) in a rectangular region of the device context with another color (clrColorFill)
6 Dec 2012 by Jibesh
Simple Drag and Drop functionality in a dialog.
2 Feb 2016 by MaxMax14
Keep the items highlighted when focus is on another control
17 Oct 2014 by majid torfi
HexCounter, Calculate the number HEX duplicate
4 May 2012 by _Flaviu
A class designed to connect to a database through ODBC and perform basic operations such as inserts, updates, and deletes
13 Nov 2011 by geoyar
I am using CString str(_T("Test"));typedef std::basic_string string_t;string_t resStr(str);It works because the CSting has a cast to LPTCSTR.
29 Aug 2014 by Ștefan-Mihai MOGA
A quick solution to transform binary data to plain text
11 Aug 2020 by Bob Van Tuyl
How to set landscape mode in MFC app
9 Feb 2015 by Member 11246861
Under laptop's control, microcontroller sends sensor data to laptop that displays numbers and graphic.
20 Aug 2023 by Ștefan-Mihai MOGA
How to save a message to an MSG Compound file.
5 Jan 2011 by Mukit, Ataul
This tip is about creating a cursor from an icon
8 Dec 2022 by Alexey Shtykov
Activate a particular document window in MDI application via MFC/C++
20 Aug 2018 by Matt Fichtenbaum
A rich edit control's "find text" operation failed, but the same code worked in another program.
16 Dec 2014 by bishopnator29a
Simple method how to make application's window maximized on different monitors in multi-monitor setup.
3 Jul 2014 by Rob Kraft
A method is idempotent when the same input(s) always return the same output.  This method is idempotent: This method is not idempotent: When adding methods to classes, many developers spend little time deciding if the method should be idempotent.  Making use of the properties in the class causes the
16 Jun 2014 by ravenspoint
This is an alternative for "Simple DXF Reader/Viewer with Spline Support"
13 Oct 2013 by MaxMax14
For single or multiple selection CListBox
27 May 2010 by mahendra.kumar.786
Clipboard operations like cut, copy, paste on a normal CEdit control can be disabled usng subclassing.
19 Apr 2015 by Member 11246861
Some ways in which laptops and microcontrollers communicate
5 Aug 2013 by Gautam Agrawal (Programming Expert)
Enable user to make a dialog transparent without making its child control transparent
4 Dec 2013 by Mahdi Nejadsahebi
How to query a database file from an MFC application.