managed

LNK2028 Managed C++ DLL calling function in another Managed C++ DLL

时光毁灭记忆、已成空白 提交于 2019-12-04 15:54:02
I'm using VS2010 with a managed C++ DLL calling a function in another managed C++ DLL and I'm getting many LNK2028 link errors that look like this. 1>udpPkt.obj : error LNK2028: unresolved token (0A0000AA) "unsigned short __cdecl ComputeCrc16(void const *,unsigned int)" (?ComputeCrc16@@$$FYAGPBXI@Z) referenced in function "public: short __thiscall CPrivateUdpPkt::ComputeCrc(void)const " (?ComputeCrc@CPrivateUdpPkt@@$$FQBEFXZ) When I use dumpbin /export on the called DLL I see the unresolved function listed as: 7 6 00001040 ?ComputeCrc16@@YAGPBXI@Z = ?ComputeCrc16@@YAGPBXI@Z ( unsigned short _

Need 64-bit SQLite DLL for managed C# application

别说谁变了你拦得住时间么 提交于 2019-12-04 15:29:49
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 sqlite3.dll manually in the required architecture format first before I use the managed libraries. That

Loader lock (regsvr32 R6033 error) with managed C++ dll

感情迁移 提交于 2019-12-04 14:57:11
I have a C++ dll which implements several COM interfaces, that I'm trying to migrate to managed C++. I set the /clr compiler flag and changed the Runtime Library property from /MT to /MD to avoid the conflict between these two flags, but that's all I've changed. When it attempts to register the dll during the build process, I get the following error: R6033 - Attempt to use MSIL code from this assembly during native code initialization This indicates a bug in your application. It is most likely the result of calling an MSIL-compiled (/clr) function from a native constructor or from DllMain. I

Catching EngineExecutionException

 ̄綄美尐妖づ 提交于 2019-12-04 12:57:00
I have an application containing both managed and native code. The application currently has an unhandled exception filter, set via SetUnhandledExceptionFilter, which catches any critical errors, generates a minidump, records various application parameters, and exits the program. The unhandled exception handler does not catch an EngineExecutionException which occurs in the .NET runtime. We suspect the problem is memory corruption caused by the native portion of the application. The problem is, when the exception occurs, the application just exits without a trace. We'd like to record a minidump

How to use SQLite on new Windows 8.1 Store app (Visual Studio 2013)

我的梦境 提交于 2019-12-04 12:03:58
问题 So, I installed Visual Studio 2013 on my Windows 8.1 box. I want to experiment with it and created a new Windows Store Grid App . I want to persist data on a SQLite database, apparently the database of choice for WinRT apps. Quickly found links to the vsix needed in order to be able to use the SDK: SQLite download page, and downloaded sqlite-winrt81-3080002.vsix. Installed it, then in my project, added the reference to the newly installed SDK (right click references, add reference, navigate

Best method of calling managed code(c#) from unmanaged C++

佐手、 提交于 2019-12-04 11:01:21
We have developed a s/w architecture consisting of set of objects developed in C#. They make extensive use of events to notify the client of changes in status, etc. The intention originally was to allow legacy code to use these managed objects through COM interop services. That was easy to write in the design specification but, I'm seeing that actually implementing it is more problematic. I've searched for many hours looking for a good sample of event handling using this method. Before we march down that path, I want to make sure that COM interop is the best way to allow legacy code to call

Performance of Managed C++ Vs UnManaged/native C++

﹥>﹥吖頭↗ 提交于 2019-12-04 09:25:30
问题 I am writing a very high performance application that handles and processes hundreds of events every millisecond. Is Unmanaged C++ faster than managed c++? and why? Managed C++ deals with CLR instead of OS and CLR takes care of memory management, which simplifies the code and is probably also more efficient than code written by "a programmer" in unmanaged C++? or there is some other reason? When using managed, how can one then avoid dynamic memory allocation, which causes a performance hit,

How do package managed C# dlls with a managed C# application without leaving behind files?

走远了吗. 提交于 2019-12-04 02:38:56
问题 I've read through the two other threads that extract the dll from the application at run time. One of these methods used the current Windows temporary directory to save the dll in, but it was an unmanaged dll and had to be imported at runtime with DllImport . Assuming that my managed dll exported to the temporary directory, how can I properly link that managed assembly to my current MSVC# project? 回答1: You dont need to save to a temp directory at all. Just put the managed dll as an 'Embedded

How do I do typeof(int) in Managed C++?

大兔子大兔子 提交于 2019-12-03 23:33:01
I am working on a project now and part of it uses Managed C++. In the managed C++ code, I am creating a DataTable. While defining the Columns for the datatable, I need to specify the Type of the column. In C#, that would: typeof(int) but how do I do that in Managed C++? Thanks! Daniel Earwicker In C++/CLI, use the typeid keyword. e.g. Type ^t = Int32::typeid; In the older "Managed C++ Extensions" syntax, you'd use __typeof(Int32) , but that whole version of the language is severely deprecated and you should be using C++/CLI. 来源: https://stackoverflow.com/questions/1133221/how-do-i-do-typeofint

Best way to call Managed .NET code from Unmanaged code

删除回忆录丶 提交于 2019-12-03 19:34:27
问题 I'm trying to find the best performing method of calling into Managed .NET code from Unmanaged C++ code. I have found information on Hosting .NET within my C++ application and I'm able to create a pRuntimeHost and start it without a problem. The ExecuteInDefaultAppDomain seems very limited since I really want to send it a few parameters and have it return a structure of information. The most obvious alternative is to use COM methods but the current C# code isn't really setup as interfaces