Reading the registry via Win32API


I had no idea just how badly my knowledge of C programming was until I attempted to read a single value from the registry.

In the end I found that the majority of my problems were because of UNICODE being defined for Windows XP and Windows Vista. For all I know it’s probably defined for Windows 2000 and newer.

I “cheated” in a way and used the ANSI versions of the functions due to my inexperience. Hopefully I’ll be able to revisit the project in the future and fix it the way it should have been to begin with.

Sweet sweet success

Today was an interesting sort of day. I fixed the last remaining issue from the implementation yesterday of a Python script to configure printer settings and demoed a project to regulate volume levels for public access systems.

I almost couldn’t believe that I finally got the project working; albeit the code is ugly and error checking is scarce but I’m impressed that I finally managed to build something useful with C++. You can only get so far with Hello World. It was also great to see people nod in appreciation when I demonstrated it.

It’s nice to feel useful every now and then. 😉

Oh yeah, I also ruined a batch of Cream of Wheat. It turns out I didn’t burn it – I just didn’t add enough Cream of Wheat. When it failed to thicken after 2.5 minutes I chalked it up to the lack of salt (a bonehead conclusion on my part). I didn’t realize that I grabbed a 1/4 cup instead of 3/4 cup. Oh well.

I also received a very thought provoking email reply from my brother. I’ll have to mention that again when I feel like writing more.

C++ Standard update

Overview: C++ Gets an Overhaul

As I’m new, most of that is right over my head. What I do get out of it is they’re going to be adopting a lot of the Boost libraries. Little surprise there as I read a lot about the Boost libraries.

Here is one part that show how new I am to C++:

C++0x also removes some embarrassments from the language. For example, C++03 has at least three different forms of initialization:

int x=0;
int x(0);
int y[2]={1,2};

C++0x defines a unified initialization notation which can even be used in the declaration of dynamically allocated arrays:

I knew about the syntax for the first two in the list but had not seen the third or had seen it described differently.

int* a = new int[4] {1, 10, 20,95 };
vector<string> vs={"ab","cd","ef"};

class S {
 int arr[3];
  S() : arr{ 1, 2, 3 } {}

This last code block looks a little alien to me. Perhaps that’s just because my exposure to C++ classes is so limited.

Either way, this is definitely a month for change in the C++ world:

The vast number of new features forces the committee to work at an incredible speed. A clear statement of intent was made to complete work on the new standard at the San Francisco meeting of September 2008 in order to achieve publication in 2009.

Moving along

Today I’ve fleshed out the Wiki a bit more and verified that it’s now accessible to the world. I had locked it down during setup and forgot this until I attempted to validate the feed to find out why the RSS widget wasn’t working. Nothing quite like looking at the problem from the outside. Literally. 😉

I’m going to concentrate on the C++ portion first as I’m attempting to learn that language now. I’m hoping by the end of the year to be able to do something useful with it. If nothing else I’d like to have a solid understanding of References, Pointers and Classes. I plan on adding my notes on the first two pretty soon.