473,769 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>:\Progra m Files\Common Files\System\AD O\msado15.dll". When using
Windows in Portuguese, the msado15.dll is located at <drive>:\Arquiv os
de programas\Arqui vos comuns\System\A DO\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\AD O\msado15.dll" \
rename("EOF", "ADOEOF")
#else
#import "C:\Arquivo s de programas\Arqui vos
comuns\System\A DO\msado15.dll" \
rename("EOF", "ADOEOF")
#endif

Is there something that I can use?

thanks in advance

Jan 8 '07 #1
6 2280
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>:\Progra m Files\Common Files\System\AD O\msado15.dll". When using
Windows in Portuguese, the msado15.dll is located at <drive>:\Arquiv os
de programas\Arqui vos comuns\System\A DO\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 SHGetSpecialFol derPath().

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>:\Progra m Files\Common Files\System\AD O\msado15.dll". When using
Windows in Portuguese, the msado15.dll is located at <drive>:\Arquiv os
de programas\Arqui vos comuns\System\A DO\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 SHGetSpecialFol derPath().

David Wilkinson
Jan 8 '07 #3

"2112" <vc*******@gmai l.comwrote in message
news:11******** **************@ s80g2000cwa.goo glegroups.com.. .
I'm compiling a dll that imports msado15.dll.

When I'm using Windows in English, the msado15.dll is located at
<drive>:\Progra m Files\Common Files\System\AD O\msado15.dll". When using
Windows in Portuguese, the msado15.dll is located at <drive>:\Arquiv os
de programas\Arqui vos comuns\System\A DO\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\AD O\msado15.dll" \
rename("EOF", "ADOEOF")
#else
#import "C:\Arquivo s de programas\Arqui vos
comuns\System\A DO\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>:\Progra m Files\Common Files\System\AD O\msado15.dll". When using
Windows in Portuguese, the msado15.dll is located at <drive>:\Arquiv os
de programas\Arqui vos comuns\System\A DO\msado15.dll

#import "C:\Program Files\Common Files\System\AD O\msado15.dll" \
rename("EOF", "ADOEOF")
What you could try is just write

#import "msado15.dl l"

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 $(CommonProgram Files) in the
Addictional Include Directories of project properties

C/C++ -General -Additional Include Directories.

and changing that #import directive for this:

#import "System\ADO\msa do15.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
9855
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 advice what to do?? mailto: doberman@nest.ntu-kpi.kiev.ua
24
2696
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 # endif.can u pls help me out...
16
4504
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 following example. eg cosider 2 files sample.c and sample.h sample.h
13
2136
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 defined = 2;
1
1641
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 something that looks like the following: ASPX Files ASPX.VB Files Page1.aspx Page1.aspx.vb
11
345
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 with requires changing the page directive for each page between codebehind (for the IDE) and src (for the remote server). While that's a bit annoying for a single page, it's a pretty untenable approach for a website with lots of pages. Is there...
6
3135
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
2931
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 statements that the compiler does not process. The good people in the alt.comp.lang.learn.c-c++ newsgroup insist that the preprocessor is just one of many passes. The preprocessor processes a grammer unique to the preprocessor and only that grammer. ...
3
1309
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; #include "closebracket.h"
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.