Nesting Dialogs In MFC

MFC No Comments »

Below is a quick tutorial on how to nest a child dialog inside another using MFC (useful when, say, implementing your own tab-strip-like control). Disclaimer: caveat emptor — this method may be flawed, but it works for me.

Read the rest of this entry »

Avoid Mixing Debug And Release MFC Code Together

MFC No Comments »

If you have an MFC application which uses an MFC extension DLL, be careful not to mix the release version of the EXE with the debug version of the DLL or vice-versa. If you do, many fundamental things will break; e.g. AfxGetApp() will return NULL.

Beware File Open/Save Dialogs: They May Change The Current Directory

C, MFC, Win32 No Comments »

On some Windows operating systems (primarily Windows 95, 98, and ME), GetOpenFileName() and GetSaveFileName() (and wrappers of these functions such as MFC’s CFileDialog) will permanently change the process’s current working directory unless the OFN_NOCHANGEDIR option is specified. As you can imagine, this can easily break your application if you ever rely on the current working directory being set to a particular value (such as if you open files using relative paths).

Of course, it is best to eliminate any such current working directory assumptions from your application completely.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in