I've used the following to get my dialogs application directory:

CString gPath;

GetModuleFileName(NULL, gPath.GetBuffer(_MAX_PATH), _MAX_PATH);
gPath.ReleaseBuffer();

gPath = gPath.Left(gPath.ReverseFind('\\') + 1);


Is this the best way?