loadlibrary

Java: load a library that depends on other libs

一世执手 提交于 2019-12-18 13:39:21
问题 I want to load my own native libraries in my java application. Those native libraries depend upon third-party libraries (which may or may not be present when my application is installed on the client computer). Inside my java application, I ask the user to specify the location of dependent libs. Once I have this information, I am using it to update the "LD_LIBRARY_PATH" environment variable using JNI code. The following is the code snippet that I am using to change the "LD_LIBRARY_PATH"

Load Dll multiple times to allow multi threading in .Net

元气小坏坏 提交于 2019-12-18 08:27:11
问题 My .Net program uses a fortran Dll to perform a maths function (Arpack, solves eigen modes). I believe the fortran contains static varibles and generally isn't thread safe. Also it's very complicated and would probably take a lot of hard work to make it thread safe. The Dll isn't very large (700K) so I just want to load it many times (say 4, or maybe 8) to allow the threads to work concurrently. Anyone have any idea how I can do this? I hear that LoadLibrary will always return the same handle

Load the same dll multiple times [closed]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 10:06:59
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I want to load the same dll e.g. Lib.dll multiple times! -> need creating a new process (CreateProcess function) for every LoadLibrary! Anyone have an example or some hints?! Thx and greets 回答1: It sounds like

DLL Load Library - Error Code 126

╄→гoц情女王★ 提交于 2019-12-17 06:12:33
问题 I'm using the 'LoadLibrary' from the Windows API, when I run the application, it throws me an error code 126. I read that it may be caused by dependencies, I checked what's wrong with some applications like Dependency Walker, but everything was fine. LoadLibrary in the application: HMODULE dll_mod = LoadLibrary(L"path_to_dll"); if(dll_mod==NULL){ std::stringstream error; error << "Could not load plugin located at:\n" << file_full.toStdString() << "\n" << "Error Code: " << GetLastError();

DLL Load Library - Error Code 126

删除回忆录丶 提交于 2019-12-17 06:12:30
问题 I'm using the 'LoadLibrary' from the Windows API, when I run the application, it throws me an error code 126. I read that it may be caused by dependencies, I checked what's wrong with some applications like Dependency Walker, but everything was fine. LoadLibrary in the application: HMODULE dll_mod = LoadLibrary(L"path_to_dll"); if(dll_mod==NULL){ std::stringstream error; error << "Could not load plugin located at:\n" << file_full.toStdString() << "\n" << "Error Code: " << GetLastError();

LoadLibrary Static/Globals and Threads

纵饮孤独 提交于 2019-12-13 16:07:22
问题 Say I have a DLL that has the following static/global: ClassA Object; Along with the implementation of ClassA, it also contains a 'regular' ClassB, which will not work properly if ClassA has not been constructed yet (which is why I've made ClassA is a static/global). In Windows, I believe that the DLL loader will load this DLL on the call to ClassB's constructor, correct? At this point, ClassA will be constructed and then ClassB's construction will follow. If a second thread comes along and

How to pass parameters to dll?

跟風遠走 提交于 2019-12-13 07:42:02
问题 I have this function in DLL: CPPLIBRARY_API int fnCPPLibrary(int a, int b) { return a + b; } Main function: int main(){ FARPROC myCppProc; HINSTANCE hDll; DWORD L; int result; hDll = LoadLibrary("CPPLibrary"); if (hDll != NULL){ myCppProc = GetProcAddress(hDll, "fnCPPLibrary"); if (myCppProc != NULL){ result = myCppProc(); cout <<"Result from library: " <<result; int a; } } } I can easly call fnCPPLibrary when it doesn't have arguments but how to pass params from program to that dll function?

Why does Visual Studio not link correctly as a matlab mex file against the rundll?

£可爱£侵袭症+ 提交于 2019-12-13 03:58:57
问题 I have the following problem: I have a 64 bit version of matlab 2011b. I need to call some functions from a DLL. This has been working some time ago with the prof version of visual studio 2010. Now I want to get it running with the express version. I therefore installed the visual Studio C++ 2010 Express and the Win SDK 7.1. Now I give matlab the command mex -setup and select the VC++ compiler. All right! If I want to load the dll itself with loadlibrary , I get tons of errors. Something like

LoadLibrary Module Not Found - DLL Hell After Office 2007 Install

匆匆过客 提交于 2019-12-13 03:32:36
问题 Unfortunately this is going to be a pretty open-ended question, but I am at my wit's ends and I thought I would reach out for some advice. This is a Visual C++ MFC app using Visual Studio 2008 SP1. A coworker and I both had Office 2007 installed and we have both had strange DLL loading problems with our app since. Specifically, LoadLibrary is failing to load one our DLLs ( the first one it loads ) and returning error code 126 ( module not found ). What's really strange is that if I just run

Get name of missing dependencies at runtime - The specified module could not be found

萝らか妹 提交于 2019-12-12 22:50:29
问题 The following code is part of a plugin system I'm developing. Basically it loads a DLL and, if fails, shows an error message. HMODULE loadPlugin(LPTSTR path) { const auto module = LoadLibraryEx(path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); if (module != nullptr) return module; LPTSTR errorText = nullptr; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), 0, (LPTSTR)&errorText, 0, NULL); if (errorText != nullptr) {