MFC's Radio Button Hack

Disclaimer: I am a mac user, but a windows programmer. MFC is Microsoft’s old Window framework. Basically it is an object oriented wrapper around the traditional Win32 programming environment presented by Microsoft to help develop windows. Win32 is many years old, and so is MFC. Microsoft’s new frameworks, .NET and WPF (Windows Presentation Framework) are supposedly better than MFC, but I have yet to play with them. MFC has tools for many different types of controls, from buttons to dialogs, windows, and menus. MFC allows the user to create the button, override some basic functionality, provide message callbacks and otherwise manipulate the application. Buttons are particularly interesting because the base class for buttons actually provides a ton of functionality for many different types of buttons. From this one class, you can get push buttons, check boxes, radio buttons, owner draw buttons (the programmer handles the rendering of these buttons), etc. ...

September 4, 2008 · zacharyzacharyccom

Wanting To Find A Bug

This happened to me last week. Yet another lesson learned. I was working on debugging some code at work. Someone was complaining about some functionality in an element we draw on screen. In order to better diagnose the problem, I wanted to create an example and see if I couldn’t get the problem to reproduce. Not a bad first step. The problem was that as I wrote out the code I made a typo on the code I was writing. I wrote something like the following snippet: ...

September 2, 2008 · zacharyzacharyccom

Why 2 can sometimes equal 1

Ran into a fun situation today where I was writing some code, and I came across an interesting situation in C++. Now, before I get to the end of this post, I’ll give you the punch-line, Developer stupidity. So I was working on a exercise where I needed to write some sort of state machine. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 enum STATES{ STATE_1 = 0, STATE_2, STATE_3, ... }; /* ... some other code ... */ switch(state) { case STATE_1: // Do something state = STATE_2; break; case STATE_2: // Do some other stuff state = STATE_3; break; case STATE_3: // Do the last state of stuff // This code never gets called. break; } In this code STATE_3 is never reached. The code for the enum was working fine, but the state wasn’t being reached. I went over this for a while, until I found out the problem. ...

August 2, 2008 · zacharyzacharyccom

TOC on all Books Please

I shop for mostly non-fiction books. Most of these books tend to be on new and emerging technologies. When I’m purchasing a book on a technology, I really want to know the content of the book before I purchase it. What I really want is a table of contents. Just a list of the chapter lists and maybe even a more detailed list of the topics covered in each chapter, but at least some form of the table of contents would be very helpful in my purchasing decision. ...

June 15, 2008 · zacharyzacharyccom

Cheer Resource Intro

Cheer Resource is the name of my current web project. The whole goal of this project is to contribute to the cheerleading community by providing a centralized resource for cheerleaders, parents, and coaches alike to share knowledge about their programs and experiences. There is much work to be done on this project, including refining our goals and design, but most of that will be posted on the project page: https://zacharyc.com/projects/cheer-resource/ ...

April 14, 2008 · zacharyzacharyccom