Monday, April 13, 2009

Agony and pain

During these last few days I began to write the computer frontend of my Artificial Horizon application, using MFC. It has proven to be the worst decision I made since the beginning of this project. I am using Visual Studio 2008 and MFC 8.0 and I thought that Microsoft had improved the stability of MFC applications, but I was wrong. It is incredibly buggy, and the IDE seems to work against the programmer. Every time I added a header file, I had to restart Visual Studio to update IntelliSense, if I deleted a simple editbox from the Resource View I had to manually delete all the references that were automatically added at creation and so on.

The PictureBox control of MFC only allows to display BITMAPS, and I need to be able to display PNG image files with transparency. After an extensive search on the net I learned that I could use CImage, which is an ATL template. It is capable of displaying PNG files in an MFC dialog. I easily wrote a test program, it worked fine at first glance, but after closer inspection I saw that the transparency did not extend to the picture beneath the first PNG, but only to the background color of the CImage control. Another dead end!!

Then I wrote a simple program in a Windows Forms project, which is normal Visual C++ combined with .NET. I managed to get the desired result from the use of it's PictureBox control, but the drivers for the PC/104 platform generate 240 errors at compile time...

I closed the programming session, before I exploded... After cooling of I found a possible solution, and that is to use DirectX.

I will make another post when I have some progress with DirectX.

No comments: