Adds a directory to the search path used to locate DLLs for the application.
Questions tagged [setdlldirectory]
14 questions
12
votes
3 answers
add custom DLL search path @ application startup
I'm racking my brain trying to come up with an elegant solution to a DLL load problem. I have an application that statically links to other lib files which load DLLs. I'm not loading the DLLs directly. I'd like to have some DLLs in another folder…
Sherman Wilcox
6
votes
3 answers
How to call WinAPI function SetDllDirectory() in Delphi?
I would like to prevent loading of malicious DLLs that may be possible through access of the current working directory as described in http://msdn.microsoft.com/en-us/library/ff919712(VS.85).aspx
The solution implemented in our C++ apps was to make…

Stephen
- 61
- 1
- 2
2
votes
1 answer
SetDllDirectory does not cascade, so dependency DLLs cannot be loaded
I execute an exe from a directory, say, "C:/test"
The DLLs are in the directory "C:/test/dlls" so, in this exe, I call:
SetDllDirectory("C:/test/dlls");
Then I call
lib1 = LoadLibrary("lib1.dll)
and
ptrType pr = (ptrType) ::GetProcAddress(lib1,…

marco
- 1,686
- 1
- 25
- 33
1
vote
1 answer
How can I copy dependencies from a library project to the main project?
I have an Asp.Net project (Vb.Net) that references a managed dll (library written in C#). That library project has several unmanaged dependencies dlls in a lib folder (copied into bin/Release/lib folder during build). The library is not a part of…

David Shochet
- 5,035
- 11
- 57
- 105
1
vote
2 answers
SetDllDirectory not working ( DllNotFoundException )
I'm trying to load my 32/64 bit native dll's using the same DllImport call.
Directory structure:
root:
application.exe
/win64/
stb_image.dll
/win32/
stb_image.dll
I tried using this solution but as you can see no succes.
For example this…

Matthiee
- 431
- 4
- 14
1
vote
1 answer
How might one cope with the ambiguous value produced by GetDllDirectory?
GetDllDirectory produces an ambiguous value. When the string this call produces is empty, it means one of the following:
nobody has called SetDllDirectory
somebody passed NULL to SetDllDirectory
somebody passed an empty string to…

Integer Poet
- 747
- 5
- 19
1
vote
1 answer
Calling SetDllDirectory from another process doesn't work?
I've been trying to make a way to switch the Dll directory of a program I don't own, from an "injector" program which is suppose to switch the Dll loading directory to load the modified or tapped Dlls.
Here's the function:
void AddDirectory(HANDLE…

user1591117
- 287
- 2
- 5
- 13
1
vote
3 answers
SetDllDirectory LoadLibrary inside a DLL
Can I use C++ SetDllDirectory and LoadLibrary commands inside a C++ DLL to load another DLL? I have tried using them like this:
Executable calls the 1st DLL,
then 1st DLL loads the 2nd DLL,
then 2nd DLL does the calculations...
but when I run the…

Megidd
- 7,089
- 6
- 65
- 142
0
votes
1 answer
How can I call SetDllDirectory() before [DllImport]?
I am building a .Net C# library project that needs to make calls to a function from a C++ dll. The C++ dll is located in a "lib" folder in my project. So I use [DllImport]. I need to pass to DllImport a path to C++ dll in the lib folder.
I don't…

David Shochet
- 5,035
- 11
- 57
- 105
0
votes
2 answers
Expression: string iterators incompatiable, when calling "SetDllDirectory"
I'm receiving following error:
Debug Assertion Failed!
Expression: string iterators incompatible
When trying to run such a code:
std::string string_Dir(){return ".\\Dir\\";}
std::wstring wstring_Dir=std::wstring(
string_Dir().begin()
…

Megidd
- 7,089
- 6
- 65
- 142
0
votes
1 answer
Using Octave Libraries (DLLs and so on) in C++ without installing Octave (just copying the installation folder)
In my C++ solution I have a DLL. My DLL uses Octave C++ classes and also uses Octave as "embedded" engine. By using the following steps (1st method) I can build my C++ solution and run the built executable and get the output results in some text…

Megidd
- 7,089
- 6
- 65
- 142
0
votes
1 answer
SetDllDirectory Not declared in this scope-Netbeans 7.1
I am using SetDllDirectory() in one of the codes i write however on compiling the project i get error as :
SetDllDirectory was not declared in this scope
Here's the code snippet
void LoadDLLPath() {
wxString value;
if (regkeyExists) {
if…

Linda Harrison
- 257
- 1
- 3
- 14
0
votes
1 answer
ISAPI extension loads wrong DLL
IIS loads legacy ISAPI extension and IIS module, both use DLL with same name, however these DLLs are different (linked against different versions of thirdparties). So far there should be no problem, each component (extension and module) reside in…

kreuzerkrieg
- 3,009
- 3
- 28
- 59
-1
votes
1 answer
SetDllDirectory fails with error code 183 ("Cannot create a file when that file already exists")
We're working on a Visual Studio plugin and for that we created a dll with some new functionality. Then we call SetDllDirectory to add our installation path to the dll search path, and we get error code 183 which means "Cannot create a file when…

Oren Sarid
- 143
- 1
- 12