Robert Oschler
Robert Oschler

Reputation: 11

DLL Search Path only partially searched

I just set up a new faster computer to be my development station. I'm having a problem with a DLL not begin found when I run an application I'm working on using Delphi 6 Pro, but I don't think the problem is with Delphi. Keep in mind, I have the exact same setup as far as directories and tools on my old computer and on that computer the DLL is found at runtime without fail. The symptom appears to be that only some of the directories in my PATH environment variable are being searched, and the ones added most recently are not. I have tried putting the diretory that contains the missing DLL in the current user PATH and then in the system PATH and the DLL still can not be found.

Here are some facts:

This is really strange behavior that I've never seen before. It's as if there's a ghost copy of the old PATH before certain modifications were made to it that the system is using when searching for DLLs.

Does anybody have a solution or diagnostic ideas?

Thanks.

Upvotes: 1

Views: 1712

Answers (4)

mj2008
mj2008

Reputation: 6747

Be sure you are changing the system PATH variable (using the Control Panel), and that you are then launching any process completely from fresh. If you were to run Delphi, change the path, then run the app in the debugger, then the new path will not be seen because it will inherit the PATH from the launching process, which still has the old one. You should restart Delphi to get it to see the new path.

Upvotes: 3

Mark Robinson
Mark Robinson

Reputation: 953

I had this very problem yesterday, I used:

SetDLLDirectory(DirectoryPath:PWideChar)

And this fixed it, NT based OS only apparently.

Also, I would check to make sure that you've not missed a semicolon ; (or mistyped it as colon :) from between one of the path names in the list.

Upvotes: 1

BennyBechDk
BennyBechDk

Reputation: 944

Try to se if the subdiretory 7 or 8 is incorrent (illegal path).
I have seen examples where the search stops, if an illegal entry is found.

Upvotes: 1

Jason Swager
Jason Swager

Reputation: 6501

Shorten the PATH variable by removing unnecessary paths, just for testing. I've seen the PATH grow to be too large after installation of many pieces of software that like to modify the PATH. Although the PATH variable contained all valid paths, the ones at the end would not be searched since there were too many.

Upvotes: 2

Related Questions