I am building a 32-bit C++ COM project on a 64-bit version of Windows 7. The #import looks something like:
#import "C:\Program Files\Common Files\Microsoft Shared\CAPICOM\CapiCom.dll"
The problem is, on x64, that directory doesn't work. If I change the path to C:\Program Files (x86)..., then the build works. But now it won't build on 32-bit teammate's machines.
I was able to get around this issue, by adding both "C:\Program Files (x86)" and "C:\Program Files" to the Additional Include Directories and then changing the path to be "Common Files\Microsoft Shared\CAPICOM\CapiCom.dll".
However, I have not found a solution for making a [importlib] line work on both x64 and x86 dev machines. On those I am using:
[importlib("C:\\Program Files\\Common Files\\Microsoft Shared\\CAPICOM\\CapiCom.dll")]
to limited success. I have tried using %ProgramFiles(x86)%, but didn't get it working. I'm hoping there is a simple #define I can use, or a project setting where I can add both paths.
Thanks.