
[John Maddock]
I'm using import libraries - my test project is attached - no errors are generated even though they have hardcoded mismatched #pragma detect_mismatch's.
[Holger Grund]
That doesn't work across PE images out of the box -- and arguably it's not necessarily a good idea to flag these mismatches as an error. So long as DLL & EXE have an interface that doesn't rely on STL constructs, there's no problem.
If your interface relies on STL constructs, you could add an object file to the import library, make sure it's linked in by the consuming side and so trigger validation.
I naively expected this to work automatically, but Holger's excellent explanation reveals why it doesn't. Our enabled-by-default validation for static linking is very obviously the correct default. This disabled-by-default validation for dynamic linking is a tougher call, but I tend to agree that it's desirable. STL