Joseph M. Newcomer

Latest articles
-
A guide to sorting
by Joseph M. NewcomerLearn two sorting algorithms, and how to use these to sort CListBox, ComboBox, and CListCtrl controls
-
Creating your own GUIDs
by Joseph M. NewcomerGUIDs are a useful entity to guarantee that you have a unique name for a kernel object, Registered Window Message, clipboard format, or other object that must be guaranteed to be unique. However, there are times when a program needs to create a GUID; for example, a program that writes .h files. This essay tells how I created my own unique IDs.
-
Asynchronous Process Notification
by Joseph M. NewcomerThis example consists of a simple dialog-based application that can launch another application and have the GUI remain alive while the launched process runs, instead of just blocking and being non-responsive.
-
Process Management
by Joseph M. NewcomerSome techniques for managing processes in a program. Oriented to MFC programmers, since it includes MFC examples and defines a class for asynchronous process completion notification.
-
Saving the DC context
by Joseph M. NewcomerHaving trouble keeping your DC intact? Here's an article on how to do this far more easily using ::SaveDC/::RestoreDC, or CDC::SaveDC/CDC::RestoreDC, as well as a C++ class to make it even easier
-
Surviving the Release Version
by Joseph M. NewcomerOK, you've built the project, debugged it, and you're ready to ship. You compile the Release version of the program, and your world crumbles to dust. Find out what can be wrong, and what you can do about it.
-
Optimization: Your Worst Enemy
by Joseph M. NewcomerOptimizing a program before you know where the time is going is a meaningless activity. It wastes your time, produces code that is harder to write, harder to debug, and harder to maintain, than unoptimized code. This essay discusses some of the issues of why you should not do pre-optimization.
-
Using User-Interface Threads
by Joseph M. NewcomerI discovered the utility of user-interface threads a few weeks ago. This essay captures what I learned. In particular, there are some interesting issues of thread initialization that are not readily addressed. This also discusses why a user-interface thread may have no GUI objects associated with it
-
Avoiding Multiple Instances of an Application
by Joseph M. NewcomerIn Win16 it was easy: you looked at the hPrevInstance parameter to WinMain and if it was nonzero, you were the second instance. Done. In Win32 it isn't as easy. And there are several wrong ways, and some that don't work at all. This essay explores the techniques and tells you what the pitfalls are,
-
Worker Threads
by Joseph M. NewcomerThis describes techniques for proper use of worker threads. It is based on several years' experience in programming multithreaded applications.