MFC Feature Pack

At the beginning of January, Microsoft released a beta version of MFC Feature Pack, an exstension to the MFC shipped with Visual Studio 2008. This feature pack allows developers to create applications with the look and feel of Office, Visual Studio and Internet Explorer. MFC application can now support: Office Ribbon Office 2003, XP and … Read more

Convert.ToInt32 versus TryParse

There are two way of converting strings to numerical values in .NET. The first one, supported since the first version of the platform, is the use of System.Convert class. It has methods like ToInt32, ToChar, ToDouble, ToDataTime, ToDecimal, etc. Here is an example of converting string “123” to numerical value 123. string text = “123”; … Read more

Visual Studio Gallery

Microsoft launched yesterday Visual Studio Gallery, a site hosting Visual Studio extensions. Currently, there are over 350 such extension, free or per charge. The extension include macros, add-ins, packages, project templates. A good thing is that anybody can contribute with content to this gallery. There are some very good extensions available in the gallery. You … Read more

Microsoft DreamSpark

Recently Microsoft launched a program called DreamSpark addressed to students from all over the world (though currently the program is available only in 10 countries) that allows them to used for free software created by Microsoft. This includes: development tools: Visual Studio 2005 Professional Edition Visual Studio 2008 Professional Edition XNA Game Studio 2.0, 12-month … Read more

Microsoft Office Binary File Formats

Last week Microsoft published the 97- 2007 binary file formats for Word, Excel, PowerPoint and Drawing. They can be downloaded from here. Joel Spolsky has a very good article on the subject. A normal programmer would conclude that Office’s binary file formats: are deliberately obfuscated are the product of a demented Borg mind were created … Read more

Forward Declaration for a Class from a Namespace

Suppose you have a class declare in a namespace, like this: #pragma once namespace Test { class foo { public: foo(void); ~foo(void); }; }; #include “foo.h” namespace Test { foo::foo(void) { } foo::~foo(void) { } }; And you want to use that foo class in a another class, with a forward declaration: #pragma once class … Read more

C# ListBox with Variable Height Items

Suppose you need a ListBox that has to display items with the text spread across multiple lines. With the default implementation that would look like this: The CR LF characters are displayed as squares and the item has only one line of text. To make the list box items have variable height depending on the … Read more

STL string utils

STL’s std::string doesn’t have methods for transforming the string to upper or lower case or for trimming (as other string implementations, such as CString, have). I’ve noticed that many people don’t know how to implement such functions, so I’ll show you here how to do that. class stringutils { public: static void make_upper(std::string& text) { … Read more

End of 2007

I started this blog at the beginning of 2007 and until now I had more than 10,000 unique visits, which is pretty good, I believe. I wrote here about LINQ, C#, C++, Visual Studio, events and others. I hope they served the readers well, and I’ll try to write more during the next year. This … Read more

Sphere inside out

I was reading a book about Mobius band and I read about turning a sphere inside out, without making a hole in it. Though this appears impossible, it is actual possible when you follow some rules. Looking over the web I found a very good movie showing and explaining how it’s done. For those interested in … Read more