dll

Freeing memory allocated in a different DLL

喜欢而已 提交于 2019-12-28 06:33:06
问题 I have an EXE file using a DLL file which is using another DLL file. This situation has arisen: In DLL file 1: class abc { static bool FindSubFolders(const std::string & sFolderToCheck, std::vector< std::string > & vecSubFoldersFound); } In DLL file 2: void aFunction() { std::vector<std::string> folders; std::string sLocation; ... abc::FindSubFolders(sLocation, folders) } In release mode, everything works fine. But in debug mode, I come up with an assertion failure in the destructor of one of

How to use a dll outside of the system path

僤鯓⒐⒋嵵緔 提交于 2019-12-28 05:33:07
问题 I made an application that uses the openssl dlls ( libeay32.dll and ssleay32.dll ). It is indy using them, I don't call the dlls directly. The simplest workaround i found to avoid an installer (i just delpoy an exe and i am ok with this approach) is to: put the dlls as resources of the exe on program start I extract them in the exe folder the exe uses them This is perfect but I would like to improve the approach by extracting the dlls in a temp folder and not on the exe folder (that in many

What is the use of .exp and what is the difference between .lib and .dll?

為{幸葍}努か 提交于 2019-12-28 04:51:04
问题 During compilation and linking, what is use of .exp? What is the difference between .lib and .dll? I know that .lib will be used, while linking and .dll will be used when running the program. But what exactly is the difference between .lib and .dll? Does .lib file not contain the code for the functions coming from .dll files? What is the need for using two separate files? Please clarify. 回答1: In the case of an import library for a DLL, the .lib file does not contain any actual code at all. It

WindowsError: [Error 126] when loading a DLL with ctypes

我是研究僧i 提交于 2019-12-28 04:09:04
问题 This works fine on Windows 7 with Python 2.7: lib = ctypes.cdll.LoadLibrary('prov_means') provmeans = lib.provmeans The library prov_means.DLL is in my working directory. It exports a simple, stand-alone C function provmeans() with no dependencies. When I try the same thing on Windows XP and Python 2.7 I get Traceback (most recent call last): File "D:\python\Auxil\src\auxil.py", line 130, in <module> lib = ctypes.cdll.LoadLibrary('prov_means') File "C:\Python27\lib\ctypes\__init__.py", line

DIRCA_CHECKFX Return Value 3 - VS 2013 Deployment Project

被刻印的时光 ゝ 提交于 2019-12-28 03:38:10
问题 I have the dreaded issue from my attempted installation of an MSI: MSI (c) (98:B0) [18:01:22:818]: Invoking remote custom action. DLL: C:\DOCUME~1\sspencer\LOCALS~1\Temp\1\MSI19.tmp, Entrypoint: CheckFX MSI (c) (98:FC) [18:01:22:833]: Cloaking enabled. MSI (c) (98:FC) [18:01:22:833]: Attempting to enable all disabled privileges before calling Install on Server MSI (c) (98:FC) [18:01:22:833]: Connected to service for CA interface. Action ended 18:01:22: DIRCA_CheckFX. Return value 3. After

Maven project with native dependency and copying files

做~自己de王妃 提交于 2019-12-28 02:55:16
问题 I have the following scenario: mylib is a library (for which I have the sources, so I'd like to put them into a Maven project mylib:mylib for example). This library has a jar dependency for which I only have the jar, and it is not to be found in the Maven repository (and I do NOT want to install it there either). To make it compile, something like this would work: add the jar file to the mylib project in a "lib" folder, e.g. "lib/thirdpartylib.jar" and in mylib's pom.xml, add a dependency

Use Visual Studio 2012 and compile with older platform toolset?

邮差的信 提交于 2019-12-28 02:44:07
问题 The problem I'm using Visual Studio 2012 to develop C++ DLLs. On some machines these DLLs can not be loaded, because the platform toolset, which is set to "v110" is missing. I have tried to install older c++ runtimes. They didn't install because "a newer version is already installed". I also installed the current Windows SDK, but there are still no other items to choose from than v110. Question How can I compile my C++ DLL with an older version of the C++ runtime so it will run on non

Why does this program crash: passing of std::string between DLLs

假装没事ソ 提交于 2019-12-27 20:07:21
问题 I have some trouble figuring out why the following crashes (MSVC9): //// the following compiles to A.dll with release runtime linked dynamically //A.h class A { __declspec(dllexport) std::string getString(); }; //A.cpp #include "A.h" std::string A::getString() { return "I am a string."; } //// the following compiles to main.exe with debug runtime linked dynamically #include "A.h" int main() { A a; std::string s = a.getString(); return 0; } // crash on exit Obviously (?) this is due to the

Exporting a C++ class from a DLL

无人久伴 提交于 2019-12-27 11:42:12
问题 Most of my C/C++ development involves monolithic module files and absolutely no classes whatsoever, so usually when I need to make a DLL with accessible functions I just export them using the standard __declspec(dllexport) directive. Then access them either dynamically via LoadLibrary() or at compile time with a header and lib file. How do you do this when you want to export an entire class (and all it's public methods and properties)? Is it possible to dynamically load that class at runtime

Win32 API to enumerate dll export functions?

倖福魔咒の 提交于 2019-12-27 10:21:48
问题 I found similar questions but no answer to what I am looking for. So here goes: For a native Win32 dll, is there a Win32 API to enumerate its export function names? 回答1: dumpbin /exports is pretty much what you want, but that's a developer tool, not a Win32 API. LoadLibraryEx with DONT_RESOLVE_DLL_REFERENCES is heavily cautioned against, but happens to be useful for this particular case – it does the heavy lifting of mapping the DLL into memory (but you don't actually need or want to use