Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: where do I set the .dll location in Project->Options?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: May 12, 2016 9:38 AM Last Post By: Remy Lebeau (Te...
John Hobbie

Posts: 17
Registered: 7/15/07
where do I set the .dll location in Project->Options?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 11, 2016 1:25 PM
I have the problem solved for now, but I would like an answer for the future. I am using a .dll that is used by several of my programs. I have not found in the wiki for C++ seattle where it is in the Project->Options dialog that you set where a .dll file is to be found. The wiki just says to put it in C:\Windows\System; that will work. However, most other .dlls are located in C:\Windows\System32; if your .dll is put there, your Seattle program won't find it. For the record, in my 'puter's Win7, C:\Windows\System was empty before I put my .dll in it.

I've un-installed my earlier versions of Borland/Embarcadero C++ builders so I can't test it, but my recollection is that they picked up the .dll in Windows\System32 without any additional modifications to the Options. The problem comes in that I have deployed other software that uses that same .dll and all programs found the dll in System32. If the location of the .dll file can not be defined in Seattle, it will mean that the dll file, which contains a large resource file, will have to reside in two locations.

My question is: Where in Project->Options can you point to the .dll location such that a Seattle 10 program will find it?

I will probably be giving my forehead a "dope slap" when I get the answer from one of you, but I just can't find it in the wiki.

Thanks,

Hobbie
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: where do I set the .dll location in Project->Options?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 11, 2016 1:59 PM   in response to: John Hobbie in response to: John Hobbie
John wrote:

I am using a .dll that is used by several of my programs. I have not
found in the wiki for C++ seattle where it is in the Project->Options
dialog that you set where a .dll file is to be found.

You don't, because it is not a project setting. If you static-link to the
DLL, or if you dynamically load the DLL at runtime using a relative path,
then you are subject to Windows' DLL search path:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586.aspx

So if you want multiple programs to share the DLL, you have to put it in
a folder that is located in the search path, unless you code each program
to load the DLL dynamically using an absolute path instead.

The wiki just says to put it in C:\Windows\System; that will work.

No, it won't, because there is no \System folder. The wiki meant \System32
instead. But you ABSOLUTELY MUST NOT put your DLL in that folder. Non-system
(ie non-Microsoft) files do not belong in that folder, and in modern Windows
versions the OS will not allow you to do that anyway.

if your .dll is put there, your Seattle program won't find it.

If you are using a 64bit machine, the \System32 folder is meant for 64bit
files only. If the DLL is 32bit instead, it would have to go into the \SysWOW64
folder instead, which is meant for 32bit files (if you put the DLL in the
Windows folder at all, which you should not be doing).

If the location of the .dll file can not be defined in Seattle, it will
mean
that the dll file, which contains a large resource file, will have to reside
in two locations.

No, it won't. It just needs to be located in a folder that is on the DLL
search path (the \System32 folder is included in that search, but it is not
the first place Windows looks).

Where in Project->Options can you point to the .dll location such that
a Seattle 10 program will find it?

Nowhere.

--
Remy Lebeau (TeamB)
John Hobbie

Posts: 17
Registered: 7/15/07
Re: where do I set the .dll location in Project->Options?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 11, 2016 7:07 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thanks Remy --

Yeah, I need a "dope slap." Thanks for the link. Need to dig out my ol' Windows API bible and get the syntax for GetSystemDirectory.

You are an incredible asset.

Hobbie

Remy Lebeau (TeamB) wrote:
John wrote:

I am using a .dll that is used by several of my programs. I have not
found in the wiki for C++ seattle where it is in the Project->Options
dialog that you set where a .dll file is to be found.

You don't, because it is not a project setting. If you static-link to the
DLL, or if you dynamically load the DLL at runtime using a relative path,
then you are subject to Windows' DLL search path:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586.aspx

Where in Project->Options can you point to the .dll location such that
a Seattle 10 program will find it?

Nowhere.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: where do I set the .dll location in Project->Options?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 12, 2016 9:38 AM   in response to: John Hobbie in response to: John Hobbie
John wrote:

Need to dig out my ol' Windows API bible and get the syntax for GetSystemDirectory.

GetSystemDirectory function
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724373.aspx

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02