In Visual Studio, when you compile foo.idl, MIDL generates the proxy information in foo_p.c.
Unfortunately, for Win32 and x64 files, it generates the same file. For Win32, the file starts with:
#if !defined(_M_IA64) && !defined(_M_AMD64)
For x64, the file starts with:
#if defined(_M_AMD64)
When you build for Win32 and then immediately build for x64, it doesn't replace the foo_p.c file, meaning that the project fails to link.
I tried having a pre-build event that deletes the foo_p.c file if it's for the wrong architecture, but VS doesn't even bother to run that step.
How should I get it so that I can build one configuration and then the other?