I'm compiling a dll that imports msado15.dll.
When I'm using Windows in English, the msado15.dll is located at
<drive>:\Program Files\Common Files\System\ADO\msado15.dll". When using
Windows in Portuguese, the msado15.dll is located at <drive>:\Arquivos
de programas\Arquivos comuns\System\ADO\msado15.dll
I'd know if exists some preprocessor directive that could identify the
language of Windows and import msado15.dll from the correct path. For
example, suppose that WIN_ENG return the language of Windows, like
this:
#if WIN_ENG
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \
rename("EOF", "ADOEOF")
#else
#import "C:\Arquivos de programas\Arquivos
comuns\System\ADO\msado15.dll" \
rename("EOF", "ADOEOF")
#endif
Is there something that I can use?
thanks in advance
David Wilkinson - 08 Jan 2007 12:11 GMT
> I'm compiling a dll that imports msado15.dll.
>
[quoted text clipped - 5 lines]
> I'd know if exists some preprocessor directive that could identify the
> language of Windows and import msado15.dll from the correct path.
2112:
Take a look at SHGetSpecialFolderPath().
David Wilkinson
2112 - 08 Jan 2007 12:16 GMT
Ok, but it's a function, not a preprocessor directive
> > I'm compiling a dll that imports msado15.dll.
> >
[quoted text clipped - 11 lines]
>
> David Wilkinson
David Wilkinson - 08 Jan 2007 14:19 GMT
> Ok, but it's a function, not a preprocessor directive
2112:
Oops, sorry, didn't read your post properly. I'll try again:
Can you not, on each machine, just put the appropriate path in the list
of executable directories in the VC settings? Then you can just write
#import <msado15.dll>
David Wilkinson
2112 - 08 Jan 2007 15:07 GMT
I solved the problem adding the macro $(CommonProgramFiles) in the
Addictional Include Directories of project properties
C/C++ -> General -> Additional Include Directories.
and changing that #import directive for this:
#import "System\ADO\msado15.dll" \
rename("EOF", "ADOEOF")
This worked fine for me.
Thank you all.
> > Ok, but it's a function, not a preprocessor directive
>
[quoted text clipped - 8 lines]
>
> David Wilkinson
Cholo Lennon - 08 Jan 2007 13:38 GMT
> I'm compiling a dll that imports msado15.dll.
>
[quoted text clipped - 20 lines]
>
> thanks in advance
One solution (in general, not recommended due to version updates, but may be
valid in this case) could be to maintain a copy of msado15.dll in the
project directory for to import tlb data from there.
BTW, I have the same problem by with spanish/english versions of Windows ;-)
Regards
--
Cholo Lennon
Bs.As.
ARG
Eberhard Schefold - 08 Jan 2007 14:13 GMT
> When I'm using Windows in English, the msado15.dll is located at
> <drive>:\Program Files\Common Files\System\ADO\msado15.dll". When using
[quoted text clipped - 3 lines]
> #import "C:\Program Files\Common Files\System\ADO\msado15.dll" \
> rename("EOF", "ADOEOF")
What you could try is just write
#import "msado15.dll"
and add the respective path for every VC installation under the VC
installation-wide settings (as opposed to the project specific settings)
under Options | Directories| Executable Files. I believe #import follows
this path. (Add a comment to the #import line then.)
What you could try alternatively is #import via progid or libid instead
of the explicit DLL.