Questions tagged [loadlibrary]
558 questions
6
votes
2 answers
C++/CLI Explicitly Load Managed DLL at runtime (the equivalent of LoadLibrary for Unmanaged)
Problem 1:
Is there a way to explicitly load a library at runtime instead of at compile time in C++/CLI. Currently I am using the .NET "Add Reference" at compile time.
I would like to explicitly load a managed dll. Is there the .NET equivalent of…
user295190
6
votes
5 answers
C++: Include vs LoadLibrary()
I am having some trouble understanding why both #include and LoadLibrary() is needed in C++. In C++ "#include" forces the pre-processor to replace the #include line with the contents of the file you are including (usually a header file containing…

Magnus
- 6,791
- 8
- 53
- 84
5
votes
6 answers
What might prevent a DLL from loading with LoadLibrary?
I have a JD Edwards business function, which is written in Microsoft Visual C++ as a C module. I'm using LoadLibrary to access a third party DLL. In a standalone test program, the code runs just fine. When I run it from within JDE, LoadLibrary…

Mark Ransom
- 299,747
- 42
- 398
- 622
5
votes
1 answer
Tweak DLL module name during LoadLibrary
I want to load at runtime a third party binary plug-in (P.dll) in my application (A.exe). This plug-in has been built for another application (B.exe).
The plug-in has implicit dll import on the B.exe module, like :
Module Name : B.exe
func1
func2…

Hulud
- 69
- 4
5
votes
3 answers
LoadLibrary fails: First chance exception 0xC0000139 (DLL Not Found) - How to debug?
I have a dll "mytest.dll" that when loaded via LoadLibrary(), returns NULL (and 127 as the GetLastError()). If I use DependencyWalker on "mytest.dll", it reports that it should load correctly and that all DLLs are found correctly. Running the…

PeteVasi
- 723
- 2
- 10
- 23
5
votes
3 answers
Passing pointer argument in MATLAB to a C-DLL function foo(char**)
I am writing a C-DLL to be called from MATLAB.
Is it possible to call a function with const char ** parameter? e.g.
void myGetVersion( const char ** );
The C code would be:
const char *version=0;
myGetVersion( &version );
What would be…

Valentin H
- 7,240
- 12
- 61
- 111
5
votes
2 answers
Does LoadLibrary parse environment variables such as %windir%
If I do LoadLibrary("%windir%\\system32\\ole32.dll") does that mean Windows will ONLY load from "c:\windows\system32\ole32.dll" ? Also does LoadLibrary() in C understand the environment variable?

unixman83
- 9,421
- 10
- 68
- 102
5
votes
2 answers
C++ How to control Image Base of LoadLibrary API
After Rebasing the main program very high up in it's own imagebase.
How do I guarantee that the dll that gets loaded will load in 0x400000
dllImageBase = LoadLibrary("test.dll");
printf("imagebase = 0x%x", dllImageBase);
I always get 0x460000…

SSpoke
- 5,656
- 10
- 72
- 124
5
votes
3 answers
Loading Mixed-Mode C++/CLI .dll (and dependencies) dynamically from unmanaged c++
I have a managed C++ assembly I'm loading dynamically in an unmanaged c++ application through a standard LoadLibrary() call. The managed C++ assembly has dependencies on several more managed (C#) assemblies. Everything worked fine until I moved all…

Jordan0Day
- 1,386
- 4
- 15
- 25
5
votes
1 answer
Does one definition rule apply to dynamically loading shared libraries at runtime?
If I load a dll or so library at runtime using dlopen() on unix or LoadLibrary() on windows, do i need to ensure that the symbols in the library do not have the same names as symbols in my program? Also is it possible to load multiple shared…

Aart Odding
- 123
- 7
5
votes
1 answer
Reusing locally downloaded Android libraries
I usually have issues with power and steady internet connectivity.
Thus I'm wondering if it is:
Possible to import a library that exists in an existing local project of mine to a new project. Without having to add the library dependency (or even if…

Peterstev Uremgba
- 699
- 8
- 14
5
votes
1 answer
How to make LoadLibrary to show error dialog when there are missing dependencies
Suppose we have two dynamic libraries libfoo.dll and libbar.dll, given that libbar.dll depends on libfoo.dll. Further we compile an executable test.exe that loads our libbar.dll using WinAPI function LoadLibrary().
If we run text.exe on Windows XP…

Henadzi Matuts
- 345
- 2
- 10
5
votes
1 answer
Are Win32 applications automatically linked against ntdll.dll?
I've just found out by accident that doing this GetModuleHandle("ntdll.dll") works without a previous call to LoadLibrary("ntdll.dll").
This means ntdll.dll is already loaded in my process.
Is it safe to assume that ntdll.dll will always be loaded…

GetFree
- 40,278
- 18
- 77
- 104
5
votes
3 answers
LoadLibrary fails with error code 193
I'm stuck as to why I can't load my dll "interfac" using LoadLibrary. It seems to be failing when loading a dependency but I'm not sure why.
Here's the code:
AfxMessageBox(L"before load library");
HMODULE interfacDll =…

markf78
- 597
- 2
- 7
- 25
5
votes
3 answers
Incorporate vuforia android SDK in a new project
I want to use vuforia sdk's text recognition module in my new app.
I have been successful in building and running their sample apps. However, having done that was apparently not enough for me to figure out how to start using vuforia android sdk in…

Abdul Wasae
- 3,614
- 4
- 34
- 56