managed-c++

Could not load file or assembly '***.dll' or one of its dependencies

巧了我就是萌 提交于 2019-11-28 05:47:20
I have this dll that I created a long time ago and use to connect to the db of a specific software that I develop for. I have had no issues for well over 4 years and countless applications with this dll. Trying to deploy my latest creation, I get the following error: System.IO.FileNotFoundException: Could not load file or assembly '***.dll' or one of its dependencies. The specified module could not be found. So, for every dll I ever wrote, I always made a simple forms application to test that dll just by itself. Running that simple app yielded the same error. The dll doesn't load or use

EEFileLoadException when using C# classes in C++(win32 app)

☆樱花仙子☆ 提交于 2019-11-27 20:04:57
For deployment reasons, I am trying to use IJW to wrap a C# assembly in C++ instead of using a COM Callable Wrapper. I've done it on other projects, but on this one, I am getting an EEFileLoadException. Any help would be appreciated! Managed C++ wrapper code (this is in a DLL): extern "C" __declspec(dllexport) IMyObject* CreateMyObject(void) { //this class references c# in the constructor return new CMyWrapper( ); } extern "C" __declspec(dllexport) void DeleteMyObject(IMyObject* pConfigFile) { delete pConfigFile; } extern "C" __declspec(dllexport) void TestFunction(void) { ::MessageBox(NULL,

convert from std::string to String^

不羁岁月 提交于 2019-11-27 16:23:28
I have a function in C++ that have a value in std::string type and would like to convert it to String^. void(String ^outValue) { std::string str("Hello World"); outValue = str; } Googling reveals marshal_as (untested): // marshal_as_test.cpp // compile with: /clr #include <stdlib.h> #include <string> #include <msclr\marshal_cppstd.h> using namespace System; using namespace msclr::interop; int main() { std::string message = "Test String to Marshal"; String^ result; result = marshal_as<String^>( message ); return 0; } Also see Overview of Marshaling . From MSDN: #include <string> #include

What is the Managed C++ equivalent to the C# using statement

心已入冬 提交于 2019-11-27 15:44:37
问题 How would one code the following C# code in Managed C++ void Foo() { using (SqlConnection con = new SqlConnection("connectionStringGoesHere")) { //do stuff } } Clarificaton: For managed objects. 回答1: Assuming you mean C++/CLI (not the old Managed C++), the following are your options: (1) Mimic a using-Block with using automatic / stackbased objects: { SqlConnection conn(connectionString); } This will call the Destructor of the "conn" Object when the next enclosing block ends. Whether this is

C++/CLI Support in .Net Core

泪湿孤枕 提交于 2019-11-27 13:04:46
问题 Our project structure is like, native.dll :- This contains pure native code written in c\c++. This native.dll exposes some functions using *def file. Wrapper Library(wrapper.dll compiled with .Net framework v4.0) :- In order to use functionality of native.dll , a Wrapper lib(wrapper.dll) is written in C++\CLI using :clr\oldsyntax . This wrapper has all code of Interoperability and Marshalling . Application(Console App v4.0) directly uses wrapper.dll to use functionality provided by native.dll

How to display quick-updating images without large memory allocation?

孤街浪徒 提交于 2019-11-27 12:27:23
问题 I've got a WPF application on an ultrasound machine that displays ultrasound images generated in C++ at a speed upwards of 30 frames per second. From what I understand, the normal process for displaying images in WPF is to create a BitmapSource for your image and set the Source for your Image, which then causes it to invalidate and display. Since BitmapSources do not implement IDisposable, using this method forced me to create 30 BitmapSources a second. For a 640x480 image with 32bppArgb

System.IO.FileNotFoundException: Could not load file or assembly 'X' or one of its dependencies when deploying the application

心不动则不痛 提交于 2019-11-27 09:12:07
I'm having a strange problem with deploying an application, which references an assembly, written in managed c++. I've created an assembly X, compiled it and referenced it in an exe file, called Starter. Starter.exe starts normally on local mashine. However, when I copy ALL contents of the starter debug folder to a virtual mashine, and try to start it there, it crashes with following exception: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'X' or one of its dependencies. The specified module could not be found. This does not make any sense to me, because

Difference between managed c++ and c++ [closed]

孤街浪徒 提交于 2019-11-27 03:42:48
The topics title is actually my question. And the second question is: When do I use what of these two? When not specified, C++ is unmanaged C++, compiled to machine code. In unmanaged C++ you must manage memory allocation manually. Managed C++ is a language invented by Microsoft, that compiles to bytecode run by the .NET Framework. It uses mostly the same syntax as C++ (hence the name) but is compiled in the same way as C# or VB.NET; basically only the syntax changes, e.g. using '->' to point to a member of an object (instead of '.' in C#), using '::' for namespaces, etc. Managed C++ was made

How do I call C++/CLI from C#?

匆匆过客 提交于 2019-11-26 14:54:55
I have a class implemented in C++ that's responsible for the arithmetic computation of the program, and an interface using WPF. I process the input with C# but then how can I use my C++ class? I've seen some comments about making a managed C++ wrapper class to interact with it, but I don't know where to start. Nor do I know how I'd go to compile it along with all the other code. I can't really find a tutorial on this, and the stuff google shows on managed C++ doesn't really seem helpful. Anything out there to help me out? This doesn't seem unreasonable to me. EDIT Tried m3rLinEz solution but

System.IO.FileNotFoundException: Could not load file or assembly &#39;X&#39; or one of its dependencies when deploying the application

淺唱寂寞╮ 提交于 2019-11-26 14:29:09
问题 I'm having a strange problem with deploying an application, which references an assembly, written in managed c++. I've created an assembly X, compiled it and referenced it in an exe file, called Starter. Starter.exe starts normally on local mashine. However, when I copy ALL contents of the starter debug folder to a virtual mashine, and try to start it there, it crashes with following exception: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'X' or one of