loadlibrary

LoadLibrary fails: First chance exception 0xC0000139 (DLL Not Found) - How to debug?

泄露秘密 提交于 2019-12-07 05:17:11
问题 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 profiler option of DependencyWalker on the host exe gives me this relevant section in the log: 00:00:55.099: Loaded "mytest.DLL" at address 0x07860000 by thread 0xBBC. Successfully hooked module. 00:00:55.115: First chance exception 0xC0000139 (DLL Not

getting libstruct to work in matlab for dll pointer argument

◇◆丶佛笑我妖孽 提交于 2019-12-06 13:27:36
I'm trying to call a dll function in matlab. I have a C++ struct as shown in sixense.h: typedef struct _sixenseControllerData { float pos[3]; float rot_mat[3][3]; float joystick_x; float joystick_y; float trigger; ... } sixenseControllerData; and functions I could call: SIXENSE_EXPORT int sixenseInit( void ); SIXENSE_EXPORT int sixenseGetAllNewestData( sixenseAllControllerData * ); I can easily get this to work with calllib('sixense','sixenseInit') since there is no input, but for the function sixenseGetAllNewestData I need to have a struct pointer. I realize that libstruct is what I need to

Can .NET PInvoke dynamically load a native dll from a user specified directory?

为君一笑 提交于 2019-12-06 12:36:09
I have a .NET application and need to load a native library whose location is specified by the user. PInvoke looks like it'll only load from the global search paths (or a path specified at compile time?). Would the best method be to create a C++/CLI assembly which calls LoadLibrary at runtime? Would C++/CLI be simpler than C# PInvoking LoadLibrary? If you already have a C#/VB.Net project it would be much simpler to just PInvoke LoadLibrary in order to get a DLL to load. It takes one quick PInvoke call from the existing dll public partial class NativeMethods { /// Return Type: HMODULE-

Unmanaged Exports with Arrays

℡╲_俬逩灬. 提交于 2019-12-06 09:54:52
I'm using RGiesecke DLLExport library to produce a C# DLL that can be dynamically loaded from Delphi. I have a method like: [DllExport("GetVals", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)] static void GetVals([In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] int[] valueList, int len) { valueList = new int[3]; int[] arrList = new int[] { 1, 2, 3 }; int idx = 0; foreach (int s in arrList) { valueList[idx] = s; idx++; } } I want to be able to return an array from this call, the problem is I won't know the size of the array in advance, this will

visual studio Dll and Matlab

隐身守侯 提交于 2019-12-06 07:49:11
I am trying to build a dll with visual studio so I can use it in matlab ... I tried thausand codes with no solution !!! I am working on matlab 2013(32and64) and VS2010 ! I tried for example to write the code this way ... //The header #ifndef SIMPLEH_H #define SIMPLEH_H #ifdef __cplusplus extern "C" { int sq(int x); #endif #ifdef __cplusplus } #endif #endif //the Func(example) #include "SimpleH.h" int sq(int x) { return (x*x); } visual studio Build it and make th dll file but matlab always doesn't see the function ... What should I do /* I am really stucked :( */ Thanks in advance ... Example:

Load two instances of the same DLL in Delphi

岁酱吖の 提交于 2019-12-06 05:59:11
问题 Here's my problem: I would like to create two separate instances of the same DLL. The following doesn't work because Handle1 and Handle2 will get the same address Handle1 := LoadLibrary('mydll.dll'); Handle2 := LoadLibrary('mydll.dll'); The following works, but I have to make a copy of the DLL and rename it to something else (which seems a bit silly) Handle1 := LoadLibrary('mydll.dll'); Handle2 := LoadLibrary('mydll2.dll'); Is there a way to have only one DLL file, but load several instances

How to prevent a specific DLL from loading into my process

怎甘沉沦 提交于 2019-12-06 03:45:43
问题 I think I have researched this pretty thoroughly and I have not found an acceptable answer. First the broad strokes: Windows 8.1, Visual Studio 2013. Although, I don't think these are important. Problem as follows. The application I am writing makes use of A.dll. We use a third-party vendor product (a backup program, but again this is not important) that has installed a Context Menu Handler control under HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers. Let's say the path to this is c:

What exactly means ERROR_INVALID_ORDINAL?

倖福魔咒の 提交于 2019-12-05 17:56:34
The LoadLibrary function is returning to me the error code 182. From MSDN: ERROR_INVALID_ORDINAL: "The operating system cannot run %1" Does anyone have a better description of what this error is? Very obscure error. The term "ordinal" is however strongly associated with a DLL. A DLL contains a list of exported functions as well as a list of imported functions. Other DLLs that it has a dependency on. These exports and imports usually have a name, but that's not required. They always have a number, the number is the "ordinal". To start diagnosing this, use the SDK's Dumpbin.exe tool. Run this

Android load native library

戏子无情 提交于 2019-12-05 17:07:18
I'm trying to load a library I built with the standalone NDK toolchain. I built libGLmove.so and placed it in libs/armeabi of my Eclipse project However, the call to System.loadLibrary("GLmove") throws an UnsatisfiedLinkError Any ideas as to how to resolve the problem or make Android find my library? How does ndk-build package the library after it builds it? Edit: The exact compile flags are: /Users/thomas/Documents/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/darwin-x86/bin/arm-eabi-g++ --sysroot=/Users/thomas/Documents/android-ndk-r5b/platforms/android-8/arch-arm -march=armv7-a -mfloat

C++/CLI Explicitly Load Managed DLL at runtime (the equivalent of LoadLibrary for Unmanaged)

99封情书 提交于 2019-12-05 10:31:08
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 LoadLibrary? Update: Thanks to Randolpho Assembly::LoadFrom example from MSDN Assembly^ SampleAssembly; SampleAssembly = Assembly::LoadFrom( "c:\\Sample.Assembly.dll" ); // Obtain a reference to a method known to exist in assembly. MethodInfo^ Method = SampleAssembly->GetTypes()[ 0 ]->GetMethod( "Method1" ); // Obtain a reference to the parameters