Mar 152012

I’ve been using MFC since the first version was released back in the early 90’s. I’ve heard rumor of its demise more than once. There are likely millions of applications and thousands of useful examples using MFC based code.

The recent announcements of Windows 8 and Visual Studio 11 have changed direction with respect to the desktop’s part in the user’s paradigm. Windows 8 will work on desktop machines, but it’s really being tailored for use with mobile devices and tablet based computers. This is a good thing for Windows. Windows 8 will help Microsoft migrate to the new “ecosystem” of the future where most of use will consume applications on our phones, tablets, and desktop computers. Windows 8 will help homogenize the look and feel of what we see and will, ultimately, make it easier to use all of these devices since we’ll see basically the same thing on all of them.

Of course, this leaves some of us with legacy code written in MFC/C++. Some of my applications are hundreds of thousands of lines of code. Many of them have been developed over many years. I’m sure some of you are like me and simply unable to turn on a dime when it comes to migrating applications to new versions of Windows.

The good news, for us, is it will take several years still for Windows 8 to become the standard. If history repeats it will be at least a year after release before most people will upgrade. Most upgrades will happen as people buy new computers.

The other good news is all of our MFC code will still run on Windows 8 under the desktop mode. We won’t have the same look and feel as a Windows 8 Metro application, but our users won’t be stranded if they upgrade.

Even more good news. With the advent of Windows 8/Metro and Visual Studio 11 C++ once again becomes a major player for Windows development. So, those of us who have invested years of lives learning C++ will once again have a first class, modern, language to use in our Windows development.

The whole new direction sort of reminds me of when MFC first came out in Visual Studio 1.0 , back then leading up to the Windows 95 release. There were a ton of growing pains, but we were all the better for it. We had a lot to learn, but the benefits of learning it really paid off. Now, we have new “stuff” to learn in C++/CX and WinRT. I suspect the payoff will be equally as great as the world changes.

Our new programs, and code that we migrate from our previous programs will now be easily to use on all kinds of devices. That’s the promise.

In the meantime, Microsoft has thrown a few upgrade goodies and bug fixes into Visual C++ 11 to show use that they haven’t stopped working on MFC even now.

Bottom line: It will be wise for us to start embracing the new technologies, but we, and our customers, will not have to totally abandon all of our legacy applications for a really long time to come. Things just don’t move that fast in the Windows world.

Mar 152012

A friend of mine passed on this interesting use of an CImageList to make color in a bitmap transparent. It’s really simple and handy for creating bitmaps as backgrounds on dialogs or controls.

BITMAP bminfo;
CBitmap bm;
CImageList imageList;
bm.LoadBitmap(IDB_RIMAGELOGO);
bm.GetBitmap(&bminfo);
imageList.Create(bminfo.bmWidth, bminfo.bmHeight, ILC_COLOR24 | ILC_MASK, 1, 1);
imageList.SetBkColor(CLR_NONE);
imageList.Add(&bm, RGB(255, 255, 255));

Note: the second argument of the .Add() function is the color you want to make transparent.

Mar 052012

OK,once again, I can’t talk about much that I learned at the Summit this year. As you’d probably guess a lot of discussions centered around the future of C++ specifically with regards to the new Windows 8 and Visual Studio 11 technology previews which are now downloadable.

If you haven’t yet, you will definitely want to give Visual Studio 11 a look at:

Visual Studio 11

And if you have an extra machine (real or virtual) you can use you will want to look at Windows 8 as well:

Windows 8 Consumer Preview

There was a lot of excitement about all the new stuff for C++ in Visual Studio 11 and what a great part C++ will play in this future. I’ll write more later, but I wanted to get these links listed.