Win32 C ++ OS-based import path?

I work with some inherited code that has this import:

#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename("EOF", "EndOfFile")

The problem is that on the x64 machine, the path for this import is in the "Program Files (x86)" directory. Is there a preprocessor macro that I can wrap around it to make it work?

Edit1: I think I found. _M_X64, but im 100% sure this is correct. Edit2: _M_X64 looks like when you compile a FOR x64 processor. Not on one.

+3
source share
2 answers

Use the progid / libid version of the import statement ...

#import "progid:my.prog.id.1.5"

or

#import "libid:12341234-1234-1234-1234-123412341234" version("4.0") lcid("9")
+3
source

#import, , (MIDL)

  • % PATH%
  • % LIB%

, "#import" /I include.

+4

Source: https://habr.com/ru/post/1747207/


All Articles