472,958 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Preprocessor directive for program files folder

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

Jan 8 '07 #1
6 2227
2112 wrote:
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.
2112:

Take a look at SHGetSpecialFolderPath().

David Wilkinson
Jan 8 '07 #2
Ok, but it's a function, not a preprocessor directive

David Wilkinson escreveu:
2112 wrote:
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.

2112:

Take a look at SHGetSpecialFolderPath().

David Wilkinson
Jan 8 '07 #3

"2112" <vc*******@gmail.comwrote in message
news:11**********************@s80g2000cwa.googlegr oups.com...
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
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
Jan 8 '07 #4
2112 wrote:
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

#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.
Jan 8 '07 #5
2112 wrote:
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
Jan 8 '07 #6
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.
David Wilkinson escreveu:
2112 wrote:
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
Jan 8 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Boris Kuznetsov | last post by:
This occurs in an empty project when I add the following string: #using <mscorlib.dll> Can anyone tell me why would #using ... not be working???? MSDN says nothing about this error. Please...
24
by: Nalla | last post by:
Hi, I want a program. It should be a command line one. you can input the path of a folder(preferably) or a file...it should count the no. of lines between the compiler directives, ifdef win32 and...
16
by: Trying_Harder | last post by:
Is it possible to redefine a macro with global scope after undefining it in a function? If yes, could someone explain how? /If/ my question above isn't very clear you can refer to the...
13
by: Chris Croughton | last post by:
Is the following code standard-compliant, and if so what should it do? And where in the standard defines the behaviour? #include <stdio.h> #define DEF defined XXX int main(void) { int...
1
by: Jim Heavey | last post by:
I am trying to figure out the @Assembly directive. I have an application which uses "codebehind" and only uses source code, so I am using the "src=" option of the @Page directive. So I have...
11
by: Jeff | last post by:
Hi - I'm trying to get my ASP.NET pages to work the same way on my development machine (running from the VS.NET IDE) and on a remote (3rd-party) server. The only way I've been able to come up...
6
by: olivier.grant | last post by:
Hi All, I'm trying to define a macro that will allow me to write the following code : #include MY_MACRO( NAME, SPACE ) and end up with the following preprocessed code : #include NAME.hpp
31
by: Sam of California | last post by:
Is it accurate to say that "the preprocessor is just a pass in the parsing of the source file"? I responded to that comment by saying that the preprocessor is not just a pass. It processes...
3
by: vippstar | last post by:
Is this a valid implementation of stdio.h? -- stdio.h -- #ifndef __STDIO_H #define __STDIO_H /* all the necessary declarations etc */ void __dummy(void); void __dummy(void) { return;...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.