dll

Unable to pass std::wstring across DLL

非 Y 不嫁゛ 提交于 2019-12-29 07:02:52
问题 I've set up a project in Visual Studio 2010 to write unit tests against an existing MFC DLL. I'm using a single-header unit test framework, and linked to the MFC DLL's lib wrapper from the unit test project. I'm trying to construct a class that takes a std::wstring in it's constructor. Here's what my test looks like: TEST_CASE("MyProject/MyTest", "Do the test.") { MockDbService mockDbService; Foobar foo(L"{F00DFACE-FEED-DEAD-BEEF-C0FFEEDECADE}", mockDbService); foo.loadObject(); REQUIRE

Fixing the “MSVCP110D.dll is missing from your computer” issue

↘锁芯ラ 提交于 2019-12-29 06:46:16
问题 I am facing the following (fairly common) problem: I am running my program in Debug mode in VS2010 and/or VS2012, but at startup it crashes, saying: The programme can't start because MSVCP100D.dll is missing from your computer. Try reinstalling the program to fix this problem. Now I found a number of possible solutions, but none of them work for me: Compile with /MTd instead of /MDd : actually this does solve the problem, but I am not allowed to: my program is part of a bigger program, and

Determine the loaded path for DLLs

99封情书 提交于 2019-12-29 06:29:17
问题 I wish to have my application in the following structure. Exe | |----- DLL\DLL.dll, DLL\common.dll | |----- DLL2\DLL2.dll, DLL2\common.dll My EXE will load the DLLs through LoadLibraryEx(_T("DLL\\DLL.dll"), 0, 0); LoadLibraryEx(_T("DLL2\\DLL2.dll"), 0, 0); DLL.dll and DLL2.dll project will link against common.dll through lib file. There will be 2 different versions of common.dll though. However, during execution, Exe expected me to place common.dll same directory as Exe , but not same

Win32. Enable visual styles in dll

只愿长相守 提交于 2019-12-29 05:34:29
问题 I've got no experience in C++ and Win API so sorry if this question is nooby. I've got DLL where I create some components, MessageBox for example. I added pragma comment to enable visual styles and it does not work (and it shouldn't as I know from this answer: windows 7 style for combobox on internet explorer toolbar, how? Dll code(omit export and so on): #include "stdafx.h" #include "my-dll.h" #include <Windows.h> #pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft

C# GetProcAddress Returns Zero

萝らか妹 提交于 2019-12-29 05:19:24
问题 For some reason, whenever my C# .NET 2.0 application makes a call to GetProcAddress it always returns zero. public class MyClass { internal static class UnsafeNativeMethods { [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] internal static extern IntPtr LoadLibrary(string lpFileName); [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] internal static extern bool SetDllDirectory(string lpPathName); [DllImport("kernel32.dll", CharSet = CharSet.Auto,

C# GetProcAddress Returns Zero

為{幸葍}努か 提交于 2019-12-29 05:19:05
问题 For some reason, whenever my C# .NET 2.0 application makes a call to GetProcAddress it always returns zero. public class MyClass { internal static class UnsafeNativeMethods { [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] internal static extern IntPtr LoadLibrary(string lpFileName); [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] internal static extern bool SetDllDirectory(string lpPathName); [DllImport("kernel32.dll", CharSet = CharSet.Auto,

Simple VB.Net Wrapper for Ghostscript Dll [closed]

人盡茶涼 提交于 2019-12-29 03:39:11
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . I love Ghostscript. You can use it to convert pdf's to graphics files, split and/or merge pdf files, make thumbnails, and a whole bunch of other stuff. And, it's free, open-source software! There are scads of posts on web sites on how to use Ghostscript from the command line for all sorts of

Return C++ array to C#

坚强是说给别人听的谎言 提交于 2019-12-29 03:15:14
问题 I can't seem to figure out how to return an array from an exported C++ DLL to my C# program. The only thing I've found from googling was using Marshal.Copy() to copy the array into a buffer but that doesn't give me the values I'm trying to return, I don't know what it's giving me. Here's what I've been trying: Exported function: extern "C" __declspec(dllexport) int* Test() { int arr[] = {1,2,3,4,5}; return arr; } C# portion: [DllImport("Dump.dll")] public extern static int[] test(); static

64-bit SQLite.dll and Any CPU

旧巷老猫 提交于 2019-12-29 00:43:24
问题 I finally decided to post a question here after some time spent trying to figure out this problem. A few days ago I posted this same question on sqlite forum but that website is currently not available . http://sqlite.phxsoftware.com/forums/t/2669.aspx So, here is the question: I have 64-bit computer with 64-bit OS. A co-worker has 64-bit computer with 32-bit OS. We develop a web application that brings a lot of data from server and keeps it in memory SQLite database, so everything can run

Unbalanced Stack!

亡梦爱人 提交于 2019-12-28 23:04:46
问题 I have written a VC++ dll. The declaration for one of the methods in the dll is as follows: extern "C" _declspec(dllexport) void startIt(int number) { capture = cvCaptureFromCAM(number); } I use this dll in a C# code using P/Invoke. I make the declaration as: [DllImport("Tracking.dll", EntryPoint = "startIt")] public extern static void startIt(int number); and I call the function in the code as: startIt(0); Now, when this line is encountered, the compiler is throwing me this error: A call to