VS2005 debug能运行release不能运行原因集

    技术2022-05-11  16

    1. 结构体对齐问题造成。

    In fact, it looks like this is the answer - the /Zp1 option is causing problems with the new ATL-based Cstring that is being used as an argument to GetModuleHandle() in the CdllIsolationAware interface to comctl32.dll. If I rebuild with default structure alignment, the problem goes away! I guess the fact that it is working OK in debug mode but not in the release build isjust be a quirk of where things have been placed in memory (i.e. - aligned or not).