“Is MFC dead?” is arguably the most common question appearing on the VC++ newsgroups along with variants like “Does MFC have a future?” and “Can MFC applications run on Longhorn?”. A short answer would be, “No, MFC is not dead, and you can continue to develop applications using MFC and be assured that they will [...]
Entries from July 2005
Is MFC dead? Does MFC have a future?
July 28th, 2005 · 40 Comments
A rational attempt to substantiate C++/CLI as a first class CLI language
July 27th, 2005 · 2 Comments
This is my latest Code Project article and one that I’d been meaning to write for quite some time now. It explains why I think C++/CLI has an irreplaceable place among the CLI languages and demonstrates its advantages over other languages using simple code snippets where applicable. A rational attempt to substantiate C++/CLI as a [...]
Tags: C++/CLI
The coding gentleman’s guide to detecting the .NET Framework
July 27th, 2005 · No Comments
A C++ class I wrote that will detect and enumerate the active CLR versions on a machine! I am quite proud of the title I came up with for the article The coding gentleman’s guide to detecting the .NET Framework
Tags: CLR/.NET BCL
The _countof macro
July 21st, 2005 · 4 Comments
VC++ 2005 provides an _countof macro that returns the number of elements in a statically-allocated array. You cannot use it with a pointer type. It’s different from sizeof in the sense that sizeof returns the size in bytes and also works on pointers, though for pointers, it actually returns the size of the pointer (4 [...]
Tags: C++
The PathCompactPath function
July 20th, 2005 · 4 Comments
PathCompactPath is a not-so-well-known function that truncates a file path to fit within a specific pixel-width and uses ellipses to show that it’s been truncated. Here’s some sample code that shows how you can use it :- #ifndef UNICODE #define _tcout cout #else #define _tcout wcout #endif void TruncateShow(LPCTSTR buff, UINT pixels) { TCHAR tmpbuff[MAX_PATH*4] [...]
Tags: Win32/MFC
Mr .NET colorized my articles!
July 14th, 2005 · No Comments
I just installed SyntaxHighlighter for .NET written by Jambo Johnson (Mr .NET) on my website, and now the articles on my site have syntax colorization for the code snippets – just as in my blog. My blog uses Jambo’s WordPress colorizer plugin developed in PHP and this new .NET colorizer is a .NET port of [...]
Tags: General
Locking splitter windows
July 12th, 2005 · 2 Comments
Earlier today, someone asked on the vc.mfc NG how he can lock his splitter windows. I replied to him asking him to handle WM_SETCURSOR, WM_LBUTTONDOWN and WM_LBUTTONUP in a CSplitterWnd derived class and to call the base class implementation only if locking is disabled. Later, I decided to try it out and found that there [...]
Tags: Win32/MFC
The set is sorted – searching is faster!
July 11th, 2005 · 1 Comment
In my last blog entry, I had said that the set container was better than a vector container only in the fact that its elements were sorted. Well this gives it a huge advantage when it comes to finding an element. Take a look at the following code snippet that populates a vector, a list [...]
Tags: C++
Why have a multiset container?
July 8th, 2005 · 2 Comments
I was wondering about a plausible scenario where people would need to use the STL multiset associative container. On a different note, I am still puzzled as to why set and multiset are even called associative containers considering that they don’t associate their keys with any data like map and multimap do. In fact I [...]
Tags: C++
There’s nothing wrong in posting messages!
July 1st, 2005 · 2 Comments
Mike Dunn said that to me a few minutes ago and I thought that, taken out of perspective, that sentence is pretty funny Well, for those who didn’t get it yet, we weren’t talking about posting messages on a bulletin board or Instant Messenger messages; we were talking about posting Win32 messages! It happened this [...]
Tags: Win32/MFC