Click here to Skip to main content

Articles by Joseph M. Newcomer (Articles: 54)

Articles: 54

RSS Feed

Average article rating: 4.26

Button Controls

A Better Bitmap Button Class
Posted: 16 May 2000   Updated: 14 Oct 2001   Views: 314,071   Rating: 3.51/5    Votes: 32   Popularity: 5.23
Licence: Not specified      Bookmarked: 74   Downloaded: 6,221
An improvement on the CBitmapButton class.
An AutoRepeat Button Class
Posted: 14 Apr 2002   Updated: 14 Apr 2002   Views: 117,633   Rating: 4.06/5    Votes: 11   Popularity: 4.23
Licence: Not specified      Bookmarked: 49   Downloaded: 1,256
A button control that autorepeats after a set period of time

Combo & List Boxes

Combo Box Initialization
Posted: 16 May 2000   Updated: 16 May 2000   Views: 137,175   Rating: 4.23/5    Votes: 25   Popularity: 5.91
Licence: Not specified      Bookmarked: 29   Downloaded: 1,163
Learn how to programmatically initialize a combo box.
A Logging Listbox Control
Posted: 16 May 2000   Updated: 16 May 2000   Views: 139,331   Rating: 4.76/5    Votes: 20   Popularity: 6.19
Licence: Not specified      Bookmarked: 65   Downloaded: 2,169
Learn how to use printf-like functionality to debug your GUI applications.
A CListBox with automatic HSCROLL maintenance
Posted: 27 Mar 2001   Updated: 27 Jun 2001   Views: 114,444   Rating: 4.07/5    Votes: 25   Popularity: 5.69
Licence: Not specified      Bookmarked: 36   Downloaded: 1,135
Taking the pain out of adding a horizontal scrollbar to a listbox.

Dialogs and Windows

Threads and Pipes in Console Apps
Posted: 30 Jun 2008   Updated: 10 Jul 2008   Views: 39,128   Rating: 4.91/5    Votes: 23   Popularity: 6.69
Licence: The Code Project Open License (CPOL)      Bookmarked: 52   Downloaded: 370
When a dynamically-resizable dialog is created, you may find it desirable to have controls resize or rearrange themselves dynamically in response to these changes. This project shows some simple techniques to use when the arrangements are not too complex. It also incorporates two other projects, the
Subclassing Dialogs and Property Pages
Posted: 5 Apr 2001   Updated: 5 Apr 2001   Views: 95,226   Rating: 3.71/5    Votes: 14   Popularity: 4.26
Licence: Not specified      Bookmarked: 23   Downloaded: 0
You have a lot of dialogs that have a lot of properties in common. You'd like to derive the specialized ones from the general ones. Here's how.
Creating a Dialog-based App
Posted: 15 Oct 2001   Updated: 15 Oct 2001   Views: 180,643   Rating: 3.80/5    Votes: 25   Popularity: 5.31
Licence: Not specified      Bookmarked: 42   Downloaded: 1,081
This is my method of creating dialog-based apps, and in addition, illustrates how to handle the Enter key in an edit control.
Dialog Box Control Management
Posted: 16 May 2000   Updated: 16 May 2000   Views: 97,270   Rating: 4.03/5    Votes: 30   Popularity: 5.96
Licence: Not specified      Bookmarked: 43   Downloaded: 0
Learn how to effectively control your dialogs.
Message Management
Posted: 16 May 2000   Updated: 16 May 2000   Views: 275,567   Rating: 4.96/5    Votes: 97   Popularity: 9.86
Licence: Not specified      Bookmarked: 215   Downloaded: 0
Learn effective methods for managing your user-defined messages.
Using dialogs in console apps
Posted: 23 May 2000   Updated: 23 May 2000   Views: 91,349   Rating: 3.94/5    Votes: 15   Popularity: 4.64
Licence: Not specified      Bookmarked: 28   Downloaded: 0
Learn how to display a message box from a console application.
Using PreSubclassWindow
Posted: 24 Oct 2000   Updated: 24 Oct 2001   Views: 66,684   Rating: 4.61/5    Votes: 15   Popularity: 5.42
Licence: Not specified      Bookmarked: 32   Downloaded: 0
PreSubclassWindow is a very nice handler to use for certain effects in dialogs.
Self-Registering Windows Classes
Posted: 24 Oct 2001   Updated: 24 Oct 2001   Views: 68,258   Rating: 3.46/5    Votes: 13   Popularity: 3.86
Licence: Not specified      Bookmarked: 32   Downloaded: 873
A class that automatically registers its own Window class.

Document / View

Getting Timer Events in a CDocument-derived class
Posted: 14 Apr 2002   Updated: 14 Apr 2002   Views: 62,070   Rating: 4.11/5    Votes: 6   Popularity: 3.31
Licence: Not specified      Bookmarked: 16   Downloaded: 615
But WM_TIMER messages are not routable via the standard MFC "command routing" mechanism. This article shows you how to work around this.

Edit Controls

Avoiding EN_CHANGE notifications
Posted: 30 Jun 2008   Updated: 30 Jun 2008   Views: 23,828   Rating: 3.61/5    Votes: 10   Popularity: 3.61
Licence: The Code Project Open License (CPOL)      Bookmarked: 12   Downloaded: 0
Handling complex control interactions when edit controls are involved can lead to problems when EN_CHANGE notifications are generated by the application actually changing the control values. To avoid having to handle EN_CHANGE notifications from CEdit and CRichEdit, this article shows how to derive
A Validating Edit Control
Posted: 3 Nov 2000   Updated: 3 Nov 2000   Views: 95,788   Rating: 3.53/5    Votes: 22   Popularity: 4.74
Licence: Not specified      Bookmarked: 35   Downloaded: 1,078
A very informative, user-oriented validation edit control.

Files and Folders

A Handy Guide To Handling Handles
Posted: 4 Apr 2001   Updated: 24 Oct 2001   Views: 171,366   Rating: 4.65/5    Votes: 37   Popularity: 7.28
Licence: Not specified      Bookmarked: 51   Downloaded: 0
The secrets of File Handles and their relationship to File *, CFile, CStdioFile, etc.

Miscellaneous

Owner-Draw Control Example: A Color Table Generator
Posted: 4 Feb 2002   Updated: 4 Feb 2002   Views: 120,520   Rating: 3.76/5    Votes: 21   Popularity: 4.97
Licence: Not specified      Bookmarked: 21   Downloaded: 857
A control for generating colour gradients

Printing

A Simple Printing Mechanism
Posted: 16 May 2000   Updated: 16 May 2000   Views: 173,461   Rating: 4.05/5    Votes: 33   Popularity: 6.11
Licence: Not specified      Bookmarked: 45   Downloaded: 1,939
Learn how to implement print support in your applications.

Applications & Tools

Auto-Increment of the Build Count
Posted: 16 May 2000   Updated: 16 May 2000   Views: 100,812   Rating: 3.90/5    Votes: 18   Popularity: 4.90
Licence: Not specified      Bookmarked: 52   Downloaded: 755
Learn how to implement an auto-incrementing build number for your projects.
Dialog Shortcut Consistency Checker
Posted: 16 May 2000   Updated: 16 May 2000   Views: 35,737   Rating: 3.33/5    Votes: 3   Popularity: 1.59
Licence: Not specified      Bookmarked: 12   Downloaded: 319
A tool to check the consistency of your dialog shortcuts.
A better Zoomin utility
Posted: 17 Jun 2005   Updated: 17 Jun 2005   Views: 53,706   Rating: 4.93/5    Votes: 30   Popularity: 7.28
Licence: Not specified      Bookmarked: 52   Downloaded: 826
A better Zoomin utility.
The ViewPort Explorer
Posted: 11 Jul 2005   Updated: 11 Jul 2005   Views: 33,819   Rating: 4.89/5    Votes: 21   Popularity: 6.47
Licence: Not specified      Bookmarked: 54   Downloaded: 866
A viewport explorer utility.

GDI

Saving Drawing Contexts
Posted: 27 Mar 2001   Updated: 27 Mar 2001   Views: 75,830   Rating: 5.00/5    Votes: 27   Popularity: 7.16
Licence: Not specified      Bookmarked: 26   Downloaded: 0
GDI objects selected in a DC can't be deleted - even when you call DeleteObject. This handy class makes these potential leaks a thing of the past.
Who Owns the GUI?
Posted: 16 May 2000   Updated: 16 May 2000   Views: 55,094   Rating: 3.77/5    Votes: 30   Popularity: 5.57
Licence: Not specified      Bookmarked: 19   Downloaded: 0
Learn about who owns the GUI definition and pitfalls of GUI programming.
Drawing Techniques
Posted: 16 May 2000   Updated: 31 Mar 2001   Views: 85,252   Rating: 4.28/5    Votes: 32   Popularity: 6.42
Licence: Not specified      Bookmarked: 51   Downloaded: 0
Learn how to effectively draw your dialogs.

General Graphics

Screen Capture to the Clipboard
Posted: 5 Apr 2001   Updated: 5 Apr 2001   Views: 242,957   Rating: 5.00/5    Votes: 36   Popularity: 7.78
Licence: Not specified      Bookmarked: 81   Downloaded: 0
How do you capture the bitmap of a window? This little download shows how, and places the bitmap on the clipboard.

C / C++ Language

Attaching and Detaching Objects
Posted: 16 May 2000   Updated: 16 May 2000   Views: 87,403   Rating: 4.97/5    Votes: 38   Popularity: 7.85
Licence: Not specified      Bookmarked: 57   Downloaded: 0
Attaching and detaching MFC objects to and from Windows objects.
Callbacks, Threads, and MFC
Posted: 16 May 2000   Updated: 16 May 2000   Views: 137,356   Rating: 4.94/5    Votes: 49   Popularity: 8.35
Licence: Not specified      Bookmarked: 82   Downloaded: 0
Learn how to use callbacks and threads with MFC.
Avoiding GetDlgItem
Posted: 16 May 2000   Updated: 16 May 2000   Views: 281,064   Rating: 4.31/5    Votes: 111   Popularity: 8.82
Licence: Not specified      Bookmarked: 47   Downloaded: 0
Learn how to refrain from using GetDlgItem.
Avoiding Multiple Instances of an Application
Posted: 16 May 2000   Updated: 16 May 2000   Views: 303,176   Rating: 4.91/5    Votes: 114   Popularity: 10.10
Licence: Not specified      Bookmarked: 181   Downloaded: 0
Learn the right way to limit your application to run only one instance.
A Simple Vector Editor
Posted: 5 Jun 2002   Updated: 5 Jun 2002   Views: 90,495   Rating: 3.58/5    Votes: 20   Popularity: 4.65
Licence: Not specified      Bookmarked: 24   Downloaded: 822
A simeple editor to make my polygon class a bit more usable.
Avoiding UpdateData
Posted: 16 May 2000   Updated: 23 Apr 2007   Views: 195,428   Rating: 3.37/5    Votes: 104   Popularity: 6.80
Licence: Not specified      Bookmarked: 41   Downloaded: 0
Learn how to avoid using UpdateData in your modal dialogs.

Libraries

Dr. Joseph M. Newcomer's MVP Tips, Techniques, and Goodies
Posted: 17 May 2000   Updated: 17 May 2000   Views: 50,110   Rating: 3.25/5    Votes: 39   Popularity: 5.17
Licence: The Code Project Open License (CPOL)      Bookmarked: 51   Downloaded: 0
A collection of code examples and essays that I've often posted to the microsoft.public.vc.mfc newsgroup and other places

MFC

An MFC Interface to ::FormatMessage
Posted: 30 Jun 2008   Updated: 30 Jun 2008   Views: 18,064   Rating: 3.49/5    Votes: 11   Popularity: 3.63
Licence: The Code Project Open License (CPOL)      Bookmarked: 16   Downloaded: 0
This essay shows an interface that allows the ::FormatMessage API to be easily accessed from MFC.

Algorithms & Recipes

A Checksum Algorithm
Posted: 27 Mar 2001   Updated: 27 Mar 2001   Views: 157,996   Rating: 4.38/5    Votes: 32   Popularity: 6.59
Licence: Not specified      Bookmarked: 61   Downloaded: 0
A checksum is a value which is computed which allows you to check the validity of something. Typically, checksums are used in data transmission contexts to detect if the data has been transmitted successfully.
A General Polygon Management Routine
Posted: 24 Oct 2001   Updated: 24 Oct 2001   Views: 68,730   Rating: 3.59/5    Votes: 18   Popularity: 4.51
Licence: Not specified      Bookmarked: 30   Downloaded: 1,102
A class to make handling polygons easier.

DLLs & Assemblies

The Ultimate (DLL) Header File
Posted: 7 Nov 2000   Updated: 7 Nov 2000   Views: 130,718   Rating: 4.14/5    Votes: 32   Popularity: 6.24
Licence: Not specified      Bookmarked: 76   Downloaded: 0
Here is the ultimate header file that makes multiple declaration compiler errors a thing of the past.
Hooks and DLLs
Posted: 31 Mar 2001   Updated: 31 Mar 2001   Views: 521,350   Rating: 4.85/5    Votes: 105   Popularity: 9.80
Licence: Not specified      Bookmarked: 271   Downloaded: 7,199
There is a lot of confusion about how to set up and use global hook functions. This essay attempts to clear up some of these issues.

Programming Tips

The Graphical Developer Interface
Posted: 16 May 2000   Updated: 16 May 2000   Views: 58,359   Rating: 4.68/5    Votes: 32   Popularity: 7.05
Licence: Not specified      Bookmarked: 57   Downloaded: 0
Learn effective methods for logging and debugging your Windows apps.
Optimization: Your Worst Enemy
Posted: 16 May 2000   Updated: 12 Aug 2000   Views: 234,025   Rating: 4.91/5    Votes: 154   Popularity: 10.75
Licence: Not specified      Bookmarked: 124   Downloaded: 0
Learn about the potential pitfalls of code optimization.
Creating your own GUIDs
Posted: 17 Jul 2001   Updated: 17 Jul 2001   Views: 102,233   Rating: 2.80/5    Votes: 18   Popularity: 3.51
Licence: Not specified      Bookmarked: 24   Downloaded: 0
A simple method of creating a unique name or identifier.
Using FormatMessage
Posted: 4 Feb 2002   Updated: 4 Feb 2002   Views: 110,433   Rating: 2.90/5    Votes: 13   Popularity: 3.24
Licence: Not specified      Bookmarked: 30   Downloaded: 437
An example of one of the most effective uses of the the call to FormatMessage

String handling

CString Management
Posted: 16 May 2000   Updated: 17 May 2000   Views: 471,522   Rating: 4.94/5    Votes: 128   Popularity: 10.41
Licence: The Code Project Open License (CPOL)      Bookmarked: 269   Downloaded: 0
Learn how to effectively use CStrings.

Threads, Processes & IPC

An MFC Process Class
Posted: 15 Oct 2001   Updated: 25 Oct 2001   Views: 160,987   Rating: 4.86/5    Votes: 35   Popularity: 7.51
Licence: Not specified      Bookmarked: 59   Downloaded: 1,594
This class allows you to create a child process and receive notification of its output.
An Introduction to Processes: Asynchronous Process Notification
Posted: 16 May 2000   Updated: 16 May 2000   Views: 137,172   Rating: 4.59/5    Votes: 33   Popularity: 6.97
Licence: Not specified      Bookmarked: 89   Downloaded: 1,473
Learn how to create new processes and how to efficiently manage them.
A Fiber Class (and Friends)
Posted: 1 Jul 2008   Updated: 1 Jul 2008   Views: 16,756   Rating: 4.88/5    Votes: 20   Popularity: 6.34
Licence: The Code Project Open License (CPOL)      Bookmarked: 31   Downloaded: 100
Fibers are a lightweigtht cooperative threading mechanism, or a coroutine mechanism, depending on how you look at them. Besides providing a very efficient thread-like implementation, fibers allow you to provide "continuations", that is, computations which perform some function, suspend themselves, a
Using User-Interface Threads
Posted: 16 May 2000   Updated: 16 May 2000   Views: 283,887   Rating: 4.25/5    Votes: 42   Popularity: 6.90
Licence: Not specified      Bookmarked: 115   Downloaded: 0
Learn tricks on how to create and use a User-Interface thread.
Using Worker Threads
Posted: 16 May 2000   Updated: 5 Apr 2001   Views: 657,213   Rating: 4.93/5    Votes: 210   Popularity: 11.46
Licence: Not specified      Bookmarked: 375   Downloaded: 0
Learn how to create and use worker threads in your applications.
Using Semaphores: Multithreaded Producer/Consumer
Posted: 14 Jun 2001   Updated: 14 Jun 2001   Views: 203,167   Rating: 4.97/5    Votes: 34   Popularity: 7.62
Licence: Not specified      Bookmarked: 82   Downloaded: 2,127
An introduction to using Semaphores.

Debug Tips

Surviving the Release Version
Posted: 16 May 2000   Updated: 16 Jul 2001   Views: 330,899   Rating: 4.98/5    Votes: 172   Popularity: 11.13
Licence: Not specified      Bookmarked: 230   Downloaded: 0
Learn about the issues and differences between Debug and Release builds.

Hardware & System

Time is the Simplest Thing...
Posted: 2 Jun 2000   Updated: 2 Jun 2000   Views: 147,046   Rating: 4.65/5    Votes: 78   Popularity: 8.79
Licence: Not specified      Bookmarked: 68   Downloaded: 0
Explains misconceptions about timing in Windows.
How Big Is My Program
Posted: 4 Apr 2001   Updated: 4 Apr 2001   Views: 62,724   Rating: 4.69/5    Votes: 35   Popularity: 7.24
Licence: Not specified      Bookmarked: 32   Downloaded: 0
A discussion on the working size of your executable, and why you shouldn't believe those numbers PView or task manager tell you.
A Registry Class
Posted: 27 Mar 2001   Updated: 27 Mar 2001   Views: 65,130   Rating: 4.10/5    Votes: 20   Popularity: 5.33
Licence: Not specified      Bookmarked: 42   Downloaded: 1,128
This represents a handy set of classes I built to ease the pain of dealing with the Registry.
No blogs have been submitted.
No video articles have been posted.
No tips have been posted.

Joseph M. Newcomer



United States United States

Member



Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 27 May 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid