Click here to Skip to main content
15,889,867 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 Updated

MFC 

20 Feb 2024 by Ștefan-Mihai MOGA
A look at the URLDownloadToFile function and architecture of IntelliLink
29 Jan 2024 by Ștefan-Mihai MOGA
How to implement the missing CMFCListView class
20 Aug 2023 by Ștefan-Mihai MOGA
How to save a message to an MSG Compound file.
8 Dec 2022 by Alexey Shtykov
Activate a particular document window in MDI application via MFC/C++
21 Mar 2022 by Roger65
How to type text into a static control, change the font used and then save it into a bitmap
9 Sep 2021 by _Flaviu
A simple way to convert an office document to PDF
21 May 2021 by rev78
Simply bypass the 255 columns in MFC CRecordset
4 Mar 2021 by Southmountain
glaux.h header file & glaux.lib can be replaced by freeglut.h & freeglut.lib
18 Dec 2020 by ferdo
How to compile MFC sources with VS 2019 (for ARM64 too)
4 Dec 2020 by Eddie Nambulus
CheckBox as an item in CComboBox
11 Aug 2020 by Bob Van Tuyl
How to set landscape mode in MFC app
4 Jul 2020 by Michael Haephrati
How to set write direction and alignment
10 Jun 2020 by fernando amatulli
Polynomial interpolation algorithm from 1 to 9 degree that allow forcing constant term to 0
13 May 2020 by Apprieu (Apprieu)
How to generate a serial key with Crypto API MFC
28 Jan 2019 by Roger65
Selected Font name, Point Size and Weight are displayed
20 Aug 2018 by Matt Fichtenbaum
A rich edit control's "find text" operation failed, but the same code worked in another program.
15 Apr 2018 by hofingerandi
Workaround for a bug in the CMFCEditBrowseCtrl that causes heavy flickering (starting with Windows 7)
13 Apr 2018 by _Flaviu
A method of how to get rid of "close" menu from multiple CDockablePane panels
26 Oct 2017 by Rick York
Something to help compile samples from the VS2010 feature pack
8 Oct 2017 by _Flaviu
A memory CTreeCtrl like object, but resident in memory only
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.
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
29 Jul 2016 by PawelBujak
How to avoid blocking long operations in GUI applications, that lead to hung state.
25 Jul 2016 by David Wincelberg
A simple way to display "item" or "items" instead of "item(s)"
24 May 2016 by Christian Koberg
How to use CAsyncSocket in a console application? Is it possible at all?
23 Mar 2016 by _Flaviu
A way to know when a floating CDialogBar is closed
2 Mar 2016 by Antonio Miras
Programatically set a static IP, subnet mask and gateway to an ethernet network adapter on your local machine
13 Feb 2016 by JPhelps
To dynamically set the password viewing style for the edit control
2 Feb 2016 by MaxMax14
Keep the items highlighted when focus is on another control
11 Oct 2015 by Member 11246861
Wifi communication between RaspberryPi2 and Laptop ASUS: fonts English, Russian.
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
17 Aug 2015 by Sweta Mittal
Validate whether value in string is a valid decimal number or not.
24 May 2015 by JPhelps
Using CFolderPickerDialog
19 Apr 2015 by Member 11246861
Some ways in which laptops and microcontrollers communicate
21 Mar 2015 by SaahilPriya
The sample demonstrates how to count the number of OLE Automation Objects running at a particular time.
9 Mar 2015 by sunhui
Integrate .NET Component to your Native MFC Application at runtime
28 Feb 2015 by aljodav
A simple, short and easy way to display a JSON object in a browser (motivated by a forum question)
27 Feb 2015 by aljodav
An easy way to encrypt files that are automatically decrypted in the same user account
26 Feb 2015 by aljodav
Easily reading CodeProject RSS feed for new articles from a MFC Application
9 Feb 2015 by Member 11246861
Under laptop's control, microcontroller sends sensor data to laptop that displays numbers and graphic.
5 Jan 2015 by zdanman
Fully Customizable ProgressBar Control with Percentage shown that changes color as progress covers it
28 Dec 2014 by Akos Mattiassich
Find a window on the desktop, spy its properties and manipulate it.
22 Dec 2014 by TyrWang
Use CResizeWnd as an add-on to any dialog
16 Dec 2014 by bishopnator29a
Simple method how to make application's window maximized on different monitors in multi-monitor setup.
9 Dec 2014 by Emiliarge
How to statically link a Win32 Project with Visual C++ libraries (m***.dll)
17 Oct 2014 by majid torfi
HexCounter, Calculate the number HEX duplicate
30 Aug 2014 by Javad Taheri (drjackool)
How to use read only option in Vista common file dialog
29 Aug 2014 by Ștefan-Mihai MOGA
A quick solution to transform binary data to plain text
10 Jul 2014 by _Flaviu
A small guide to use VTK in MFC
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
20 Jun 2014 by M Sheik Uduman Ali
Don’t use elephant for your garden work
16 Jun 2014 by ravenspoint
This is an alternative for "Simple DXF Reader/Viewer with Spline Support"
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 →
22 Apr 2014 by SaahilPriya
Connect Systems using WMI Services, Remote as well as Local
5 Mar 2014 by rbrunton
Using Windows hooks to capture mouse action.
4 Dec 2013 by Mahdi Nejadsahebi
How to query a database file from an MFC application.
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.
20 Nov 2013 by Richard MacCutchan
Obscure a window or the screen and show a dialog.
13 Oct 2013 by MaxMax14
For single or multiple selection CListBox
13 Sep 2013 by Hasan Gurler
Simple DXF reader and viewer supporting the most common AutoCAD entities
5 Aug 2013 by Gautam Agrawal (Programming Expert)
Enable user to make a dialog transparent without making its child control transparent
4 Aug 2013 by Ashish Ranjan Mishra
How to add sub menus dynamically, adding event for them and also retrieving the menu name on click event of individual sub menu
31 Jul 2013 by Thomas B Dignan
Getting the text of Win32 Error codes for 99% of cases.
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.
22 Apr 2013 by bkelly13
Multiple Projects in One Solution
9 Apr 2013 by _Flaviu
Improved Excel class
6 Apr 2013 by ReturnVoid
Working example: OpenGL CDialog Multiple Context
27 Mar 2013 by Aydin Homay
Minor changes on CGridCtrl 2.27 for compatibility with old version of this control
29 Jan 2013 by Roger65
Find file or use wildcard i.e. dlg*.h, or *.*
22 Jan 2013 by kennethman
Hide data inside the zip structure of any zip-based file.
6 Dec 2012 by Jibesh
Simple Drag and Drop functionality in a dialog.
28 Jun 2012 by Binu MD
Change GUI control position with dialog re-size
19 Jun 2012 by Binu MD
Change the default ICON of MFC applications
30 May 2012 by anscode
This post describes a slider control for C++ which make your application more attractive.
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
17 Apr 2012 by lxdfigo
A Photoshop-Like Color Palette Dialog in MFC
24 Mar 2012 by Mukit, Ataul
This tip shows how to save a 24 bitmap to a file given filename, pixel data, bitmap width and bitmap height
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
2 Mar 2012 by SuperFun21
A general function using MFC that runs a command using CreateProcess(), waits for it to terminate, and returns its ExitCode.
21 Feb 2012 by Jochen Arndt
Information about COleDataSource not contained in the Microsoft documentation or hardly to be found
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)
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.
23 Jan 2012 by Roger65
CFileDialog in a Console Application
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.
8 Dec 2011 by Ștefan-Mihai MOGA
How to get the MAPI server nane
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...
13 Nov 2011 by .dan.g.
Displaying the 'new' Vista/Windows 7 File Dialog in 'old' MFC Apps
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.
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);
30 Oct 2011 by steveb
In UNICODE:CString str = L"Test";std::wstring ws(str);std::string s;s.assign(ws.begin(), ws.end());
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
15 Aug 2011 by Ștefan-Mihai MOGA
How to find a substring in a text, forward and backward, with Case Sensitive and Match Whole Word options.
20 Jul 2011 by Mukit, Ataul
this tip tells about a tool that converts a win32 rc file to XML
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