dll

Loading a 32-bit dll in a 64-bit process [duplicate]

末鹿安然 提交于 2019-12-30 11:03:42
问题 This question already has answers here : Target 32 Bit or 64 Bit native DLL depending on environment (3 answers) DllImport - An attempt was made to load a program with an incorrect format [duplicate] (1 answer) Closed 5 years ago . I want my C# application to conditionally run a native method, conditionally choosing to run either the x86 or the x64 version of the dll. Whenever I try to load the 32 bit dll I get the below error: Unhandled Exception: System.BadImageFormatException: An attempt

.dll Plugin that uses functions defined in the main executable

99封情书 提交于 2019-12-30 10:04:20
问题 I have a Main executable that loads . dll / .so Plugins, which works just fine in Linux but on windows(Visual Studio 2012), it fails with undefined reference errors. The plugin uses functions like session->SendLine("bla") which are defined in the Main executable. (class of session ans methods defined in a .h included in the plugin, but the actual function in a .cpp compiled in main exec). tl;dr: "I need the windows linker to ignore undefined references in plugins, defined in the main

.dll Plugin that uses functions defined in the main executable

允我心安 提交于 2019-12-30 10:02:46
问题 I have a Main executable that loads . dll / .so Plugins, which works just fine in Linux but on windows(Visual Studio 2012), it fails with undefined reference errors. The plugin uses functions like session->SendLine("bla") which are defined in the Main executable. (class of session ans methods defined in a .h included in the plugin, but the actual function in a .cpp compiled in main exec). tl;dr: "I need the windows linker to ignore undefined references in plugins, defined in the main

Python: accessing DLL function using ctypes — access by function *name* fails

帅比萌擦擦* 提交于 2019-12-30 08:32:21
问题 myPythonClient (below) wants to invoke a ringBell function (loaded from a DLL using ctypes ). However, attempting to access ringBell via its name results in an AttributeError . Why? RingBell.h contains namespace MyNamespace { class MyClass { public: static __declspec(dllexport) int ringBell ( void ) ; } ; } RingBell.cpp contains #include <iostream> #include "RingBell.h" namespace MyNamespace { int __cdecl MyClass::ringBell ( void ) { std::cout << "\a" ; return 0 ; } } myPythonClient.py

Delphi's Sharemem - When it is not needed

柔情痞子 提交于 2019-12-30 08:25:31
问题 I know that when I share strings between a Delphi APP and a Delphi DLL I need to add Sharemem in both app and dll project source as the first unit in uses clause. But, if the dll exports function that accept only Pchars but inside some of the dll methods I use strings , should I use sharemem as well? Let me shown a sample code: procedure ShowMyCustomMessage(aMessage : Pchar); var vUselessString : string; begin vUselessString := aMessage; ShowMessage(vUselessString); end; exports

Dynamically loading a dll in C#

扶醉桌前 提交于 2019-12-30 07:33:24
问题 I have a window to use for editing. The editor should load a dll (which I have full control of) in response to the user's selection to know how to display the information visually. (They're dll's, as a user will not necessarily want or need every single display model, and also allow new ones to be added without messing around with the main project) They will all simply be stored in a subdirectory (for now anyway) I'm pretty sure I can enumerate the available dlls but I need to do 2 more

Unexpected Thread behaviour calling Delphi DLL

∥☆過路亽.° 提交于 2019-12-30 07:05:23
问题 Continue from my other question: How do I pass and retrieve memory stream from my Application to/from DLL? I have wrote the DLL using IStream as input/output. The DLL uses IXMLDocument (which at first I thought was related to the follow problem) Tested it, and it worked well in the main UI. Problems began when I was calling the DLL from a worker thread. The DLL: library MyDLL; uses Windows, Variants, SysUtils, Classes, AxCtrls, ActiveX, XMLDoc, XMLIntf; {$R *.res} procedure Debug(V: Variant);

Unexpected Thread behaviour calling Delphi DLL

隐身守侯 提交于 2019-12-30 07:04:43
问题 Continue from my other question: How do I pass and retrieve memory stream from my Application to/from DLL? I have wrote the DLL using IStream as input/output. The DLL uses IXMLDocument (which at first I thought was related to the follow problem) Tested it, and it worked well in the main UI. Problems began when I was calling the DLL from a worker thread. The DLL: library MyDLL; uses Windows, Variants, SysUtils, Classes, AxCtrls, ActiveX, XMLDoc, XMLIntf; {$R *.res} procedure Debug(V: Variant);

Unexpected Thread behaviour calling Delphi DLL

戏子无情 提交于 2019-12-30 07:04:27
问题 Continue from my other question: How do I pass and retrieve memory stream from my Application to/from DLL? I have wrote the DLL using IStream as input/output. The DLL uses IXMLDocument (which at first I thought was related to the follow problem) Tested it, and it worked well in the main UI. Problems began when I was calling the DLL from a worker thread. The DLL: library MyDLL; uses Windows, Variants, SysUtils, Classes, AxCtrls, ActiveX, XMLDoc, XMLIntf; {$R *.res} procedure Debug(V: Variant);

Cross platform dynamic linking (Windows to linux)

时光怂恿深爱的人放手 提交于 2019-12-30 06:42:06
问题 I have an application which I have managed to keep reasonably cross-platform between windows and Linux. Cmake and Boost have been helpful in this endeavor. The time has come to link to a .dll which has been written for windows. If I can put off the conversion of the dynamically linked library it would be a good thing. Other windows applications connect up to this library like this: HINSTANCE dll; dll = LoadLibraryA(filename); //... libFuncPtr = (libFuncPtr)GetProcAddress(dll, "libFunc"); I'd