Click here to Skip to main content
15,868,016 members
Everything / Programming Languages / C++

C++

C++

Great Reads

by Dr. WPF
.NET 3.5 SP1 is here! It's time to break out your DirectX skills. This article provides the information necessary to get started using a new DirectX interop feature in WPF called D3DImage.
by Hatem Mostafa
Artificial Neural Network C++ class with two use cases: Counter and Handwritten Digits recognition
by Jeffrey Walton
Import and export Cryptographic Keys in PKCS#8 and X.509 formats, using Crypto++, C#, and Java.
by Hans Dietrich
XColorSpectrumCtrl displays a color spectrum that allows user selection, and provides APIs for color based on RGB and HSL color models.

Latest Articles

by Yochai Timmer
A way to avoid JNI's reflection oriented programming. Wrapping Java with C++
by Mircea Neacsu
Examines the performance of SQLite in multi-threading applications
by honey the codewitch
Do you need to be able to perform a firmware update without using WiFi? This project is for you.
by Uwe_Sieber
Shows how to use IOCTL_USB_HUB_CYCLE_PORT to restart a USB port under Windows

All Articles

Sort by Score

C++ 

27 Dec 2012 by WebMaster
Some simple examples of how to apply affine transformations in computer graphics.
15 Jun 2022 by Ayush Swiss
C++, WebView2, Edge Browser, Edge in MFC application
8 Mar 2024 by PJ Arends
Trace your function calls to the Output window.
7 Mar 2010 by Luc Pattyn
This is an alternative to "Week Numbers According to ISO8601".
15 Apr 2018 by hofingerandi
Workaround for a bug in the CMFCEditBrowseCtrl that causes heavy flickering (starting with Windows 7)
18 Feb 2024 by Shao Voon Wong
Two C++ features win over C equivalents in performance
19 Feb 2016 by pasztorpisti
An advice to make your DLL interface more attractive and easier-to-maintain even in cross-platform projects
13 Sep 2013 by Hasan Gurler
Simple DXF reader and viewer supporting the most common AutoCAD entities
28 May 2010 by DecodedSolutions.co.uk
This is a simple article describing how to create an add an outlook appointment to your MS Outlook Calender.
1 Mar 2011 by Tim Stevens
An updated version of the code in David A Jones' article "Memory Leak Detection"
28 Mar 2014 by Alex Culea
Shows how to create a window that behaves like a context menu
10 May 2021 by Steffen Ploetz
Check whether ReactOS is able to run OpenGL, determine a convincing IDE and get started with the OpenGL on ReactOS.
7 Oct 2021 by Mircea Neacsu
Source code organization suggestion
25 Jul 2012 by pasztorpisti
How to open a console in a non-console C/C++ application or DLL and make printf/scanf work (stdin/stdout/stderr related functions)
19 May 2015 by Yohamnes Hernandez
How to free blocked files, inclusive if they are mapped in memory. Something that many tools are missing.
23 Jan 2020 by Steffen Ploetz
Another fully functional ownerdraw menu with minimal effort - this time based on Win32, with icons instead of bitmaps, with accelerators and tested for ReactOS and WinNT 4.0 to Windows 10
26 Mar 2021 by Southmountain
Some quick configurations to get MFC support for console application
10 Jul 2014 by _Flaviu
A small guide to use VTK in MFC
1 May 2017 by Arthur V. Ratz
This tip/trick introduces the basic ideas on how to avoid memory mismatched allocation/deallocation issues detected by Intel® Inspector XE for Visual Studio 2015
30 Sep 2017 by Alexander Lednev
How to check if a string is literal in compile-time (C++)
25 Oct 2020 by Tomaž Štih
Simple trick to implement csharpish properties in modern C++
9 Mar 2021 by Steffen Ploetz
Box, cylinder, cone and sphere construction for OpenGL with texture and light effects
2 Aug 2016 by Evgeny Pereguda
Simple article about using of Desktop Duplication API for capture desktop screen WITH image of cursor
1 Aug 2011 by ThatsAlok
Describing various method to zeroing the buffer in memory
6 Nov 2014 by Orjan Westin
Simplifying the use of dynamically sized C structs
14 Oct 2015 by Petr Kirjat Valasek
This technique allows the Visitor (i.e., an instance of Visitor design pattern) to return value of arbitrary type.
5 Mar 2017 by Jose A Pascoa
18 Mar 2019 by Martin Vorbrodt
SQL database access
17 Mar 2023 by Claudio Farassino
A small and simple C++ GroupBy with the same syntax and use of DotNet GroupBy
10 Jul 2018 by John M. Dlugosz
Did you realize that the `*this` object can be qualified with lvalue vs rvalue? Here’s what you can do with that.
4 May 2020 by BernardIE5317
Method utilizing variadic arguments and macros
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
15 May 2011 by Doc Lobster
String conversion using the C++ Standard Library only
19 Feb 2012 by Mukit, Ataul
This article shows the use of mutex's with explanations (Copied from MSDN - may prove convenient for some)
26 Mar 2015 by BrainlessLabs.com
This tip describes a n ary tree structure.
2 Mar 2016 by Antonio Miras
Programatically set a static IP, subnet mask and gateway to an ethernet network adapter on your local machine
19 Jul 2016 by Christian Koberg
Console output, general applicable to all executables on a Windows system
4 Dec 2020 by Eddie Nambulus
CheckBox as an item in CComboBox
22 Mar 2010 by PJ Arends
I have seen many different ways to check if the computer has an active internet connection. The best one, IMO, is to check for the presence of the default route in the IP forwarding table that is maintained by windows. This can be checked by using GetIPForwardTable function found in the...
24 Jul 2014 by techcap
Caution when using "yield return"
3 Nov 2016 by Eric Z (Jing)
There is an efficient way provided by std::map to solve a common programming pattern ("query-and-insert-if-nonexistent")
10 Dec 2017 by Shao Voon Wong
Make your class non-copyable without Boost
16 May 2018 by Shao Voon Wong
C++11's std::conditional tip with an endian swap example
29 Mar 2019 by Rick York
This is a simple worker thread class that allows when to use a member function as the thread function.
5 Jun 2019 by altomaltes
This code calculates square root of an integer on a few assembler code lines.
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
8 Jun 2021 by Derell Licht
Find logon time on Windows 10
18 Dec 2021 by Kai Schtrom
Win32_NetworkAdapterConfiguration WMI class in plain C and C++
19 Feb 2022 by Asif Bahrainwala
A simple C++ program to generate RSA key pair
24 Aug 2022 by honey the codewitch
std::chrono doesn't work on the Teensy? Oh no! Here's how to fix it.
17 Dec 2022 by Steffen Ploetz
High-end quality in text rendering concerns not only the characters, but also the character spaces - and here FreeType is not quite up to date anymore: The kerning used by FreeType is not always available (especially with newer fonts).
12 Feb 2011 by PrafullaVedante
Avoid using "if" with no code block parenthesis
21 Feb 2012 by Jochen Arndt
Information about COleDataSource not contained in the Microsoft documentation or hardly to be found
12 Nov 2012 by Severin Friede
This article should help you building log4cxx with Visual Studio 2010
11 Jun 2013 by shailesh91082
This tip explains how to use Safe APIs which are a replacement for older APIs like strcpy, strcat, etc.
13 Aug 2013 by Ahmed-Fayed
Using Artifecial Intelligance in the tic tac toe game to make computer never lose. Moreover two humans can play with each other.
26 Oct 2017 by Rick York
Something to help compile samples from the VS2010 feature pack
25 Jun 2019 by MaximilianW
OpenGL rendering to WPF window
1 Nov 2020 by Rick York
A Handy Memory Allocation Tracking Macro and Header for Visual Studio C++ Code
22 Nov 2020 by honey the codewitch
This is a very specialized tool that generates source code to upload files into SPIFFS on an ESP32
6 Dec 2020 by honey the codewitch
A rundown of some common tricks and pitfalls when working with SD readers for IoT gadgets
18 May 2022 by Southmountain
How to install and register .OCX components for legacy application
11 Jun 2022 by khazaad
An overview of lack of strong typing in higher order functions in modern C++ and possible solution to this problem
21 Jul 2022 by honey the codewitch
Easily blank the screen after a timeout period
27 Dec 2022 by Bruno van Dooren
What to do when you want to use the current thread handle
12 Jan 2010 by peterchen
Reusable safe_bool implementation
24 Mar 2010 by mdanh2002
On Windows Mobile, The Call Log API provides read-only access to the device call history via its PhoneOpenCallLog and PhoneGetCallLogEntry function. The .NET Compact Framework does not provide methods to access these APIs but OpenNetCF has a nice wrapper via its OpenNETCF.Phone...
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...
2 Dec 2010 by LloydA111
Very useful :) Perhaps a slight improvement would be for it to take the retrieved value (in this case 97) and take it away from 100?
15 May 2011 by Foothill
Complier Error: RC1004
16 Jun 2011 by OlegKrivtsov
Some tips on available ways of distributing CRT DLLs with your Visual C++ application
26 Jun 2011 by Mukit, Ataul
This tip shows you how to create a delegate from a C++ function pointer
28 Oct 2011 by Philippe Mori
The original solution has many flaws. Arguments and return types are not what they should be in most cases (by value vs. by reference and also for the constness). No code reuse and also some operators are not doing what would be intuitive like the unary minus.Information here is much more...
8 Dec 2011 by Ștefan-Mihai MOGA
How to get the MAPI server nane
13 Dec 2011 by KjellKod.cc
Ideone.com pastebin and online compiler with support for 40 programming languages
5 Feb 2012 by Lakamraju Raghuram
A glance around vector of bool-type
18 Feb 2012 by GregEllis
You can do it with some XORs:int a = 25, b = 7;a = a ^ b;b = b ^ a;a = a ^ b;Or the same thing with some shorthand to make the code even harder to read:a ^= b;b ^= a;a ^= b;
2 May 2012 by Itai Basel
A macro that gets current function's return type on visual C++
9 Apr 2013 by _Flaviu
Improved Excel class
1 May 2013 by Mohibur Rashid
Title says it all.
11 Dec 2013 by Mahdi Nejadsahebi
This tip describes how 3D images are converted to 2D images.
12 Jan 2014 by Vedat Ozan Oner
A library for PIR motion sensor
26 Jun 2014 by zdf
A solution for conversion of a non-undoable application to an undoable one.
30 Nov 2014 by David O'Neil
I needed an 'Update' solution for a project, and modified Geert van Horrik's 'Updater' to do so. This is the solution in Visual Studio Community Edition
15 Apr 2015 by D4rkTrick
Get manifest support with VC6
12 Apr 2016 by Shao Voon Wong
This tip presents a custom RTTI class which is 10x faster than dynamic_cast
5 Jun 2018 by Shao Voon Wong
Performance of Floating Point and Integer Arithmetic has closed gap in modern CPU
23 Jan 2020 by Steffen Ploetz
The Win32++ class library sample collection does not contain a sample, that creates the frame menu via API instead of via resources. Here is the missing part.
27 Dec 2020 by Steffen Ploetz
Step-by-step instructions and source code snippets for inserting a bitmap (or a section of it) into an icon image.
3 Aug 2021 by BernardIE5317
On certain occasions, Visual Studio does not indent as intended so here is an awk program which does the trick.
21 Mar 2022 by Roger65
How to type text into a static control, change the font used and then save it into a bitmap
12 Nov 2022 by ls6777
Task monitor for multi-threaded embedded systems
31 Oct 2022 by flyhigh
By implementing a UI library and exporting its necessary components to lua script, we can create a beautiful UI and implement relevant logic in Lua script completely.
26 Jan 2024 by Member 16179004
Capture Enter key in edit control with no dialog box and no subclass.
18 Feb 2024 by Shao Voon Wong
Make a console program not to show the console screen
19 Dec 2019 by Rick York
A simple, header-only class for high resolution timing