void Nish(char* szBlog);

Nish’s thoughts on MFC, C++/CLI and .NET

void Nish(char* szBlog); header image 4

Entries from March 2006

Avalon with C++/CLI – what are your options?

March 31st, 2006 · 8 Comments

As of today (Feb CTP), Visual C++ projects cannot have XAML in them as C# and VB projects can. Of course, this does not mean that you cannot target Avalon using C++, and if you have read my previous blog entries, you’d have seen a couple of ways how that can be done. To put [...]

[Read more →]

Tags: C++/CLI · WPF (Avalon)

Avalon – The end of HWND voyeurism!

March 30th, 2006 · 3 Comments

One fundamental aspect about Avalon controls is that they are not native HWND based controls, such as the ones you have been used to with Win32 API programming or with Windows Forms (which merely wraps the API). So if you have an Avalon window with a bunch of controls on it (say a ListBox and [...]

[Read more →]

Tags: WPF (Avalon)

Dynamically load a Xaml file from a C++ app

March 25th, 2006 · 6 Comments

While it’s an absolute tragedy that C++ does not directly support compiled Xaml, you can use Xaml dynamically from a C++ Avalon app using XamlReader::Load. Let me show you how to do that, using a simple example. You can create your Xaml file, either using a text editor or using a temporary dummy C# or [...]

[Read more →]

Tags: VC++ 2005 · WPF (Avalon)

Writing a simple Avalon app with C++/CLI

March 16th, 2006 · 5 Comments

You cannot use XAML with C++/CLI, so you’ll have to hand-code your UI, as of now anyway. Anyway, here’s what you need to do to write a simple app. Step 1 Generate a new C++/CLI project, set the subsystem to Windows, set the entry point to main, and add the following references : System (if [...]

[Read more →]

Tags: WPF (Avalon)

The SHCreateDirectoryEx API function

March 10th, 2006 · 3 Comments

Very frequently in the forums, someone posts a question asking for a function that will create a full directory path for them. For example, they may want to create c:\a\b\c\d\e\f with one call, where the intermediate folders may not exist. The answer, if you are on Win 2000 or later, is to use the SHCreateDirectoryEx [...]

[Read more →]

Tags: Win32/MFC

A near heart attack!

March 2nd, 2006 · 34 Comments

On the 20th of February, 2006, I woke up at 4:45 AM with an agonizing pain in my chest, or to be more precise, the upper left area of my chest. I couldn’t even breathe properly, it was hard to even move my body, and I panicked thinking that I was having a heart attack. [...]

[Read more →]

Tags: General · Toronto

Article – A modal dialog that fades the background to gray-scale

March 2nd, 2006 · 2 Comments

I actually published that last week, but forgot to write about it on my blog since I was engrossed in some other issues – which I’ll blog about soon. Anyway, DimmerDialog is a .NET class I wrote, that shows a modal dialog which grays out the rest of the background, just like the Windows XP [...]

[Read more →]

Tags: CLR/.NET BCL