Click here to Skip to main content
15,885,910 members
This competition has ended

Best C++/MFC article of February 2011

Contribute to CodeProject and you'll automatically be in the running for a monthly prize!

Each month at CodeProject we gather together the best of the articles submitted the previous month and ask our readers to choose the best of the best. Entry is automatic - just submit you articke and we'll do the rest.

Check out the submission guidelines for information on posting articles.

Current Entries

Articles that match the contest criteria are automatically entered.

Please Sign up or sign in to vote.
1 Mar 2011Tim Stevens
An updated version of the code in David A Jones' article "Memory Leak Detection"
Please Sign up or sign in to vote.
12 Feb 2011PrafullaVedante 2 alternatives  
Avoid using "if" with no code block parenthesis
Please Sign up or sign in to vote.
1 Feb 2011AlexCode
Image Sprites and CSS Classes creator
Please Sign up or sign in to vote.
23 Feb 2011gclass
At PDC 2009, Reed Townsend presented some very exciting multitouch samples in a presentation: Windows Touch Deep Dive. This blog covers the code behind of the custom 3D manipulations that were presented.
Please Sign up or sign in to vote.
17 Feb 2011paladin_t
Whatever, I agree with you, it would be worse in C / C++ code using macros.Suppose you got a multiline macro like this:#define some_macro \ do_something_1(); \ do_something_2();And using this macro without parenthesis:if(...) some_macro;orfor(...) ...
Please Sign up or sign in to vote.
9 Feb 2011Wolfgang_Baron
If you really have to put everything into a single function and want to keep the code analyzable and maybe want to be able put some common code at the end, you can always use a success variable. The code does not slow down, as the compiler optimizes the sequenced if-conditions away and produces...
Please Sign up or sign in to vote.
9 Feb 2011gclass
How to create Windows Touch Control Frameworks in C++ (PhotoStrip)
Please Sign up or sign in to vote.
12 Feb 2011ozkary
How to Deploy Files in Different Servers with Team Build
Please Sign up or sign in to vote.
9 Feb 2011Karl Phillip
If you are looking for a true transparent window to render your 3D objects, check this thread:http://stackoverflow.com/q/4052940/176769
Please Sign up or sign in to vote.
1 Feb 2011abridges
Alternate 8, why not just do this:bool bFailed = true;// In case of an exception.try{ // while bFailed while (bFailed) { // do something here. if (condition1) { // exit the loop (goto) bFalse = false; ...
Please Sign up or sign in to vote.
7 Feb 2011sergiogarcianinja
As this piece of code is normally a function, should be more readable if all of it is put inside a function returning a bool, indicating success or failure.The cleanup function could be only resource deallocation, not a function at all. If it is intended to use with C++ or C#, a try..finally...
Please Sign up or sign in to vote.
31 Jul 2015Faustino Frechilla
A circular array based lock-free queue with no memory allocation on the heap and no ABA problem
Please Sign up or sign in to vote.
10 Feb 2011Andrew Rissing
Always review all changes before submitting them. Especially, if using a global find and replace.
Please Sign up or sign in to vote.
21 Feb 2011Michael Dunn
A tutorial that shows how to get started using the Ribbon in your applications
Please Sign up or sign in to vote.
13 Feb 2011Sergio Mach
Posting data to an Internet server made easy with a slick C/C++ class wrapping a call to Windows sockets.
Please Sign up or sign in to vote.
10 Feb 2011Tanvi K Shah, Steve H Davis
How to give your users a smooth scrolling experience with High Resolution Mouse Wheels
Please Sign up or sign in to vote.
2 Feb 2011Volodymyr Shamray, Apriorit Inc
In this article, I’m going to describe how to implement COM interface hooks.
Please Sign up or sign in to vote.
27 Feb 2011Mladen Janković
Implementing AI for the Target Number game using a genetic algorithm.
Please Sign up or sign in to vote.
15 Oct 2012Ludvik Jerabek
Supports getopt, getopt_long, and getopt_long_only and POSIXLY_CORRECT environment flag
Please Sign up or sign in to vote.
19 Nov 2013Julijan Sribar
How to avoid flickering scrollbars that appear when resizing CListCtrl which has a last column with the LVSCW_AUTOSIZE_USEHEADER value set.
Please Sign up or sign in to vote.
26 Feb 2011Adnan Boz
How to use CPU instructions in C# to gain performace
Please Sign up or sign in to vote.
17 Aug 2011Alexander Bessonov
Introduces a fast and type-safe parameter rendering library (type-safe printf)
Please Sign up or sign in to vote.
15 Mar 2011Roman Ginzburg
A generic source filter which exposes an interface for pushing downstream RGB samples of predefined size and frame rate, and can be used for any custom frame input scenario.
Please Sign up or sign in to vote.
15 Mar 2011Roman Ginzburg
A text overlay filter and a JPEG/JPEG2000 encoder using transform filters.
Please Sign up or sign in to vote.
10 Feb 2011JimRL
Create a more robust glow with basic post processing
Please Sign up or sign in to vote.
2 Mar 2011Francis Xavier Pulikotil
A safer alternative to void*, any_ptr can point to any type of object and provide type-safe, const-correct access to it.
Please Sign up or sign in to vote.
18 Feb 2011Paul Heil
Discover how to calculate the processor usage of every running process in your Windows mobile device
Please Sign up or sign in to vote.
2 Feb 2011Mukit, Ataul
This tip shows the technique of loading a 256 color bitmap into an image list
Please Sign up or sign in to vote.
7 Feb 2011Cristian Adam
This article presents a fix for SetUnhandledExceptionFilter to work with the CRT.
Please Sign up or sign in to vote.
8 Feb 2011Mukit, Ataul
A practical example of command pattern applied in a database application
Please Sign up or sign in to vote.
6 Feb 2011User 2623109
Make this ndk-gdb finally work with threads
Please Sign up or sign in to vote.
1 Feb 2011zebulon75018
Interactive Water Effect Multitouch with Tuio Library
Please Sign up or sign in to vote.
13 Feb 2011Vince Valenti
An example of how to add a checkbox to a list view column header. We also implement select/unselect all when a user toggles the checkbox.
Please Sign up or sign in to vote.
13 Feb 2011Visual-Eleven
An owner drawn CListBox, expands items to look like a CTreeCtrl
Please Sign up or sign in to vote.
14 Feb 2011Mukit, Ataul
This tip shows how to prevent Subversion (a version/source control tool) from doing automatic merges
Please Sign up or sign in to vote.
18 Mar 2011zebulon75018
How to generate a complete UI by typing key of value of key in INI setting in QT
Please Sign up or sign in to vote.
28 Feb 2011Member 4694807
My favorite is a variant of alternative 2.{ ... DoInit(); status=DoAllActions(); DoCleanup(status); ...}int DoAllActions(){ if (condition1_fails) return status1; ... if (condition2_fails) return status2; ... if(conditionN_fails) ...
Please Sign up or sign in to vote.
24 Feb 2011Andriy Padalka
Module to dynamically assign, store, and call with handlers different functional objects: functors, functions, member functions.
Please Sign up or sign in to vote.
7 Feb 2011Jörgen Sigvardsson
Usually, gotos are used to clean up resources when exiting a function. I would recommend using the RAII[^] idiom. It also works works well in the presence of exceptions.For C# I would use IDisposable/using. If that's not possible, I'd use a finally clause to clean up.Everything else...
Please Sign up or sign in to vote.
15 Feb 2011ozkary
When there is a new version of a web service in a different URI, we usually just need to point to that new URl and get the new reference class for that service.
Please Sign up or sign in to vote.
22 Feb 2011csrss
Yet another but a little bit different INI files parser.
Please Sign up or sign in to vote.
12 Feb 2011csrss
This article describes creating and managing 1D, 2D and 3D string arrays
Please Sign up or sign in to vote.
22 Feb 2011Mukit, Ataul 1 alternative  
This tip shows how to simulate a key stroke in windows environment
Please Sign up or sign in to vote.
27 Feb 2011Roger65
Displaying big integers in dialogs.
Please Sign up or sign in to vote.
25 Feb 2011Ansas Bogdan
This shows you how to cast a Pointer to a Memberfunction to any Pointer Type you whish.

Current Participants

Those with articles that match the contest criteria are automatically entered.

Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
United States United States
I am an MCAD, MCSD, MCTS, MCPD, MCT and Certified CUDA Programmer.
You can find more technical articles on my blog at http://www.adnanboz.com.
Software Developer (Senior) HHD Software Ltd.
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Architect
Switzerland Switzerland
Senior IT Consultant working in Switzerland as Senior Software Engineer.

Find more at on my blog.
Architect
United States United States
Since I've begun my profession as a software developer, I've learned one important fact - change is inevitable. Requirements change, code changes, and life changes.

So..If you're not moving forward, you're moving backwards.
Software Developer (Senior)
Ukraine Ukraine
Now I'm working as a C++ developer and trainer and supporting
all my previously written applications.
Student
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer ORM
Poland Poland
codeceptive[at]gmail.com
Software Developer
Spain Spain
I am a software engineer who enjoys facing computer performance challenges and solving them through multi-threading and synchronisation.

I have always liked the free-software (or open-source for that matter) approach, and how it has been proved to be a way for improving our world and sharing knowledge while it's also possible to make a living out of it.

So far I had only tried to release into the free-software community a project about a board game I love: blokus (blockem.sourceforge.net). I've left the profit bit for some other project to come...
Software Developer
United States United States
Besides loving spending time with family, Francis Xavier likes to watch sci-fi/fantasy/action/drama movies, listen to music, and play video-games. After being exposed to a few video-games, he developed an interest in computer programming. He currently holds a Bachelor's degree in Computer Applications.
Web Developer Microsoft
United States United States
My name is Gus Class, I'm 29 years old, and I have been passionate about computers for my entire life. My first computer was an Apple IIgs and I begged my parents to get a PC (a 386!) around the time I had turned 7 or 8 which they begrudgingly caved in on. I came online for the first time in the early 90s through the Prodigy service which led me to the BBS scene and opened doors for learning the ins and outs of computing. I taught myself how to program in my teens, took vocational classes in high school on network administration through a magnet program, and earned a bachelor's degree in Computing and Software Systems through the University of Washington in 2003. In an effort to round out my education, I earned an MBA in 2008 while working full time at Microsoft.

I am currently a Content Project Manager at Microsoft where I have worked for the past 5 years. My work there has included writing sample code, creating compelling documentation to help developers adopt Windows features, managing sites, connecting with the developer audience through social media, mentoring and growing new hires and peers, developing tools to enhance productivity, and attending conferences as a Microsoft representative.

I enjoy a plethora of hobbies including rock climbing, DJing, electronic music production, recreational programming, creating web sites, playing and creating video games, and hanging out with social media mavens.
Software Developer (Junior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior)
Sweden Sweden
I make software.
Software Developer (Senior)
Croatia Croatia
Graduated at the Faculty of Electrical Engineering and Computing, University of Zagreb (Croatia) and received M.Sc. degree in electronics. For several years he was research and lecturing assistant in the fields of solid state electronics and electronic circuits, published several scientific and professional papers, as well as a book "Physics of Semiconductor Devices - Solved Problems with Theory" (in Croatian).
During that work he gained interest in C++ programming language and have co-written "C++ Demystified" (in Croatian), 1st edition published in 1997, 2nd in 2001, 3rd in 2010, 4th in 2014.
After book publication, completely switched to software development, programming mostly in C++ and in C#.
In 2016 coauthored the book "Python for Curious" (in Croatian).
Software Developer
Brazil Brazil
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior) VMware
United States United States
Michael lives in sunny Mountain View, California. He started programming with an Apple //e in 4th grade, graduated from UCLA with a math degree in 1994, and immediately landed a job as a QA engineer at Symantec, working on the Norton AntiVirus team. He pretty much taught himself Windows and MFC programming, and in 1999 he designed and coded a new interface for Norton AntiVirus 2000.
Mike has been a a developer at Napster and at his own lil' startup, Zabersoft, a development company he co-founded with offices in Los Angeles and Odense, Denmark. Mike is now a senior engineer at VMware.

He also enjoys his hobbies of playing pinball, bike riding, photography, and Domion on Friday nights (current favorite combo: Village + double Pirate Ship). He would get his own snooker table too if they weren't so darn big! He is also sad that he's forgotten the languages he's studied: French, Mandarin Chinese, and Japanese.

Mike was a VC MVP from 2005 to 2009.
Software Developer
Serbia Serbia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Technical Lead Kotha Technologies
Bangladesh Bangladesh
If you are not in - you are out !
- Chapter 1
Architect OG-BITechnologies
United States United States
Software engineer, author & speaker who enjoys mentoring, learning, speaking and sharing with others about software development technologies. Microsoft MVP.

My Blog
Architect
China China
Video game player & creator; Hardware geek & maker.
Software Developer (Senior) An engineering firm in Cedar Rapids, Iowa
United States United States
I'm also on the MSDN forums
http://social.msdn.microsoft.com/profile/paulh79
Software Developer (Senior) nVidia Corporation
India India
Prafulla is a passionate software developer. He has mostly worked on C++ and .NET projects. He has a Masters Degree in Software Systems from BITS, Pilani India. Currently he is working for nVidia corporation as a Senior System Engineer.

He is an embedded technology enthusiast. He likes to spend his time on electronics projects.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior)
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior)
Portugal Portugal
Financial Apps addict since early programming ages;
Statistical Apps writer;
Computer gamming and graphics programmer with a 2 commercial titles: Armor PC/PPC, MidWay XBOX/PC/PPC;
Manic Basketball fan and player;
Traveller;
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Logitech Corporation
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior)
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Web Developer
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior)
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior) Apriorit Inc
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Technical Lead private interest
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior) http://www.cmb-soft.com/
France France
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
You must sign in to participate in this contest.
This contest has ended.
1 Feb - 28 Feb 2011