I found a very dangerous define in wincore.h which has potential to break code.
The problem is that wincore defines:
#define OPENFILENAME_SIZE_VERSION_400 sizeof(OPENFILENAME)
This breaks the code afterwards unless the user includes commdlg.h BEFORE win32++ headers, which is not documented and unexpected.
Possible fix 1: check compiler version as the comment suggests and do this define for VC6 only
possible fix 2: include commdlg.h in wincore.h
Actually you should not include commdlg.h in your code at all. That is the job of the windows.h header file. Windows.h will skip the inclusion of commdlg.h if WIN32_LEAN_AND_MEAN is defined. If you need to use the features included by commdlg.h, don't define WIN32_LEAN_AND_MEAN.
My code outside Win32++ does not need all aditional stuff included when WIN32_LEAN_AND_MEAN is defined, so why make compile times longer? Even with precompiled headers full recompilation of our code base is almost 4 hours. Anyway, there's no need to argue here, I'll just keep adding #include <commdlg.h> every time I sync with your releases.
Since you mentioned compiled times of almost 4 hours, you might find the StaticLibrary useful. It might help reduce your compile times.
Thanks for the tip, I'll look into it
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.