Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / January 2007

Tip: Looking for answers? Try searching our database.

Preprocessor directive for program files folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
2112 - 08 Jan 2007 12:06 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.