Use nullptr instead of NULL whenever possible.

Microsoft recommends to avoid using NULL or zero (0) as a null pointer constant since nullptr is less vulnerable to misuse and works better in most situations.

Also fix some cases where NULL was used instead of 0 or FALSE.
Cosmetics: Use IsEmpty() instead of comparing with the empty string.
Cosmetics: Use short aliases for AfxGetAppSettings() and AfxGetMyApp().
Cosmetics: Remove extra parenthesis.
Cosmetic: Add parenthesis to make a test obvious.