Lilliput and Files: An Aventure in Endianess Issues

Background
In Jonathan Swift’s Gulliver’s Travels, the main character, Gulliver, arrives in a land of little people (called Lilliput). Here he encounters two warring factions — those that cut eggs from the little end first, and those who cut eggs from the big end first. Thus the Little-Endians and Big-Endians warred over something fairly unimportant.

Similarly, in the land of computing, there are two major factions of how to store datatypes in memory and on disk. They are also called Little-Endian (least significant first) and Big-Endian (most significant first). Please note that there are other factions. In school (and other places) we tend to learn to use binary and hexadecimal notation in Big-Endian format (where the right most digit is the ‘ones’ column).
Read more

Why don’t Focus() and SetForegroundWindow() work?

Once upon a time Microsoft decided these functions would no longer bring things to the foreground on Windows (about the time of Windows ME). Instead, these functions would make the taskbar button of the program or window flash incessantly.

This is all well and good, and I’m sure there were good intentions behind it, but quite frankly, it’s annoying when your app is supposed to come to the foreground and it doesn’t.
Read more

C++: How do I access Form1 from Form2 and vice-versa?

At first glance, this seems like an easy task. All you want to do is access a member variable or control from Form1 on Form2, and do the same from Form2 on Form1. Unfortunately, this is not the easiest thing to do, at least in (Managed) C++.
Read more

Unhandleable Exceptions

There is this wonderful error that sometimes happens when you’re running your .NET app on machines that are not your development machine:

Quote:

Application has generated an exception that could not be handled.

Read more