managed

Need 64-bit SQLite DLL for managed C# application

倾然丶 夕夏残阳落幕 提交于 2019-12-06 11:23:45
问题 I'm trying to embed SQLite into my portable C# .NET 2.0 application rather than having the DLL files included in the distribution folder. However, to embed SQLite, I cannot use the Mixed-Mode libraries provided by PHXSoftware. Instead, I am using their 'Managed Only' version. This works fine on 32-bit computers, but when it's running on a 64-bit machine, it throws a format exception. As I found out from here: http://sqlite.phxsoftware.com/forums/p/2564/9939.aspx I need to load the unmanaged

Pass string from unmanaged code to managed

北战南征 提交于 2019-12-06 04:32:30
问题 I have a problems with passing string from unmanaged code to managed. In my unmanaged class ( unmanagedClass.cpp ) I have a pointer to function from managed code: TESTCALLBACK_FUNCTION testCbFunc; TESTCALLBACK_FUNCTION takes one string and returns nothing: typedef void (*TESTCALLBACK_FUNCTION )(char* msg); Unmanaged class inherites from ITest interface which has only one method: STDMETHOD(put_TestCallBack) (THIS_ LPVOID FnAddress ) PURE; In managedClass.cs I write this code: public class

Is this .tlh file correct, and if not, then how do I generate the correct one?

点点圈 提交于 2019-12-06 03:35:17
I am trying to call a .NET 4.0 dll from unmanaged C++ code. I followed the instructions in this Code Project article by Atul Mani. I built the .NET dll, and followed all the steps up to and including registering it with regasm. Next, I created an unmanaged C++ project and added this line at the start of the .cpp file: #import "D:\PathToMyCSharpProject\bin\Debug\com.DeviceServices.tlb" rename ("EOF","adoEOF") no_namespace named_guids raw_interfaces_only When I built the C++ project, a .tlh file was created in D:\MyCPlusPlusProject\Debug. Next, I added the code suggested by the CodeProject

C++/CLI or C# for creating fast, modern and responsive GUI on Windows [closed]

ε祈祈猫儿з 提交于 2019-12-06 02:56:31
Currently I am split between these two languages. I'm almost halfway through programming my current application which needs to be very fast. It calculates insulated glass structures of any kind in multiple load-conditions. I just do not know if its the right choice to write it in C++/CLI. On the internet for example I never even read the name "C++/CLI" but everyone advises to learn C#. What are really the downsides of C++/CLI ? I have gathered from my reading that it is doomed to be deprecated in the next few years. Is this true? And if there are some, are they so bad it is really necessary to

Why does my multithreaded C++ .NET application only crash when executed outside of visual studios?

会有一股神秘感。 提交于 2019-12-05 18:34:58
I have created a very simple C++ .NET application using both managed and unmanaged code to replicate my problem. When the user clicks a button a new thread should spawn and do some time-consuming tasks while calling back to my main thread with status updates. This code compiles and successfully executes from within side of Visual Studios Express 2010. That is, when I click the "play" button, my project builds and executes without crashing. However, if I go to the Release folder where the executable lives and run it the application crashes once the button is clicked. I am compiling with /clr

Mixed management in C++

最后都变了- 提交于 2019-12-05 16:47:50
I have added a class to my program and tested it. I was really surprised that there was any real errors. Here is the code: #pragma once #include "Iingredient.h" #include <string> #include <vector> using namespace std; ref class Recipe{ private: string partsName; vector<Iingredient> ing; public: Recipe(){} }; And here are the errors: Error 23 error C4368: cannot define 'partsName' as a member of managed 'Recipe': mixed types are not supported c:\users\user\documents\visual studio 2010\projects\smestras2_l1\Recipe.h 10 1 file2_L1 Error 24 error C4368: cannot define 'ing' as a member of managed

HOWTO: Call Managed C# Interface From Unmanaged C++ On WindowsCE Compact Framework

假如想象 提交于 2019-12-05 06:37:56
I have extensive unmanaged Windows CE 5 C++ code that provides a UI that I want to use in a new product by combining it with a large amount of newer business and communications logic written in managed C# on Windows CE 6 and the Compact Framework. The UI may know about the business logic, but I want the business logic ignorant of the UI such that I can later replace it with a managed version, or any other UI that I choose as a front-end. I found an article that describes how to use COM as the bridge in the Windows world, but I'm having difficulty applying it in the .NET CF under WinCE. In the

How do I combine an unmanaged dll and a managed assembly into one file?

戏子无情 提交于 2019-12-05 04:16:09
SQLite from PHX Software has combined a managed assembly (System.Data.SQLite) with an unmanaged dll (the SQLite 32- or 64-bit dll) into one file, and managed to link them together. How do I do this? Do I need to embed the managed assembly into the unmanaged dll, or vice versa? ie. my questions are: In which order do I need to do this? What tools or knowledge do I need in order to do this? How (if different) do I link to the exported functions from the unmanaged dll in my managed code? The reason I ask this is that I want to build a managed zLib wrapper. I know there is managed classes in .NET

Arrays of strings in Managed C++

拟墨画扇 提交于 2019-12-05 03:43:05
I'm trying to write an application in Managed C++, but I cannot work out how to declare an array of strings. String^ linet[]; throws an error 'System::String ^' : a native array cannot contain this managed type So I suppose there's a different way to do this for managed data types. What exactly is it? Do you really mean Managed C++? Not C++/CLI? Assuming you're actually using C++/CLI (because of the error message you posted), there are two ways to do this: array<String^>^ managedArray = gcnew array<String^>(10); will create a managed array, i.e. the same type as string[] in C#. gcroot<String^>

What is an un/managed DLL? What is un/managed code? [duplicate]

我的未来我决定 提交于 2019-12-05 02:35:08
This question already has answers here : What is managed or unmanaged code in programming? (13 answers) Closed 6 years ago . Could someone please explain to me what an un/managed DLL is? And what is un/managed code? Sachin Shanbhag You will get a fair idea on managed and unmanaged code in following article - http://www.developer.com/net/cplus/article.php/2197621/Managed-Unmanaged-Native-What-Kind-of-Code-Is-This.htm Unmanged code will be compiled to machine language to run directly on the hardware. Managed code will be compiled to a virtual machine called CLR (Common Language Runtime), and