unmanaged

How to debug exception not handled by CLR

谁都会走 提交于 2019-12-06 14:14:09
问题 I am developing a .NET application which is crashing at seemingly random times. It has references to an unmanaged dll which I suspect is throwing an exception which is unhandled. When the application crashes, I get this message when no debugger is attached (compiled as click-once): At which point I can attach VS2012 as the debugger and see the call stack: > ntdll.dll!77e015de() Unknown [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!77e015de() Unknown

Marshalling C dll code into C#

别来无恙 提交于 2019-12-06 13:34:19
I have the following C-code signature in a dll: extern __declspec(dllexport) unsigned char * funct_name (int *w, int *h, char **enc, int len, unsigned char *text, int *lp, int *mp, int *ep) The C function can modify w, h, enc, lp, mp, and ep (though the latter three can be null and it won't do anything. I'm using the following in C# [DllImport("iec16022ecc200.dll", EntryPoint = "iec16022ecc200", ExactSpelling = false, CharSet = CharSet.Ansi, SetLastError = true, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr CallEncode( [In,Out,MarshalAs(UnmanagedType.LPArray)] Int32[] width,

How to debug System.ExecutionEngineException in a framework code of a managed application

 ̄綄美尐妖づ 提交于 2019-12-06 10:34:17
I have an application running as service. The application crashes time to time. The application is written in vb.net and runs its tasks at new thread (one at time). I have collected crash dumps and started analyzing. From analyze of log file created by the application (analysis of dump supports it) it seems that a crash occurs when no task is running and application is waiting for a next System.Timers.Timer event. First I loaded a .dmp file to VS2010: Process Architecture: x86 Exception Code: 0xC0000005 Exception Information: The thread tried to read from or write to a virtual address for

Whats the best to call QuantLib methods from C#

一笑奈何 提交于 2019-12-06 10:21:55
问题 I am gonna use QuantLib in C# app (http://quantlib.org/docs.shtml) but I don't trust their .NET conversion project (too immature). I need only options valuation part. anyone used it in managed app? whats the best approach? 回答1: What I have done in a similar situation is implementing a C++ native dll as an adapter between the C# and C++ projects. From C# you can access your dll interface with DllImport. In the dll you can reach the full C++ interface, but it is worth simplifying it to your

Neo4J server startup error after enabling the unmanaged extension configuration

跟風遠走 提交于 2019-12-06 10:01:31
I am using Neo4J community edition 2.3.0 on windows OS 10. Everything works well until I changed the configuration at neo4j-server.properties files as: org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged The error at server startup is: Starting Neo4j failed: org.neo4j.server.web.NeoServletContainer-5b85e832@73766070==org.neo4j.server.web.NeoServletContainer,-1,false If I disable this change then server starts very well. I am trying to run the HelloWorld example for the unmanaged extension as given with the Neo4J tutorial and follow all the

Unmanaged Exports with Arrays

℡╲_俬逩灬. 提交于 2019-12-06 09:54:52
I'm using RGiesecke DLLExport library to produce a C# DLL that can be dynamically loaded from Delphi. I have a method like: [DllExport("GetVals", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)] static void GetVals([In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] int[] valueList, int len) { valueList = new int[3]; int[] arrList = new int[] { 1, 2, 3 }; int idx = 0; foreach (int s in arrList) { valueList[idx] = s; idx++; } } I want to be able to return an array from this call, the problem is I won't know the size of the array in advance, this will

mono and unmanaged code in ubuntu

╄→尐↘猪︶ㄣ 提交于 2019-12-06 08:59:06
问题 I'm using Mono 2.10 running on Ubuntu 12 x64. Now I need to know how to use unmanaged code. [DllImport("libc.so")] public static extern int getpid (); And, in the next step I have: getpid(); and I recieve this errorL $ MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono libc_test.exe Mono: DllImport attempting to load: 'libc.so'. Mono: DllImport loading library: '/home/ibaranov/Documents/MONO/libc_test/libc_test/bin/Debug/libc.so'. Mono: DllImport error loading library '/home/ibaranov/Documents

Is it possible to have Code Analysis warnings formatted like normal ones?

允我心安 提交于 2019-12-06 06:49:25
I like the code analysis included in VS2012. But it's a bit annoying that the warnings are only processable in the Code Analysis window, and not by stepping through the build output with F4 . Is there a way to overcome this limitation? How could I format the output of the static code analysis like normal compiler output (i.e. don't only print the filename but the correct path to the file being inspected)? I'm not using FxCop since I'm working with unmanaged code. For unmanaged code analysis, the MSBuild scripts use /analyze:quiet instead of /analyze in order to prevent writing results to the

Interop with unmanaged code in ASP.net vNext

只谈情不闲聊 提交于 2019-12-06 06:49:01
What's the story going to be (if any) around interop with unmanaged code for ASP.net vNext / Core CLR? The key bits (DllImport and friends) appear to be present to allow for unmanaged code interop, but how would things such as packaging and deployment work in this context? The basic build artifact in vNext / CoreFX no longer appears to be an assembly, but a NuGet package. So in that case, how would we make the new project.json system work so that unmanaged dlls that we're P/Invoking into are also included in the resulting NuGet package? Or am I talking about scenarios that have not been

Qt xmlWriter/xmlReader

北慕城南 提交于 2019-12-06 05:49:21
I want to write and read an xml file using Qt. Is there a simple example code, which generates an XML file dynamically? I've found some Qt xml classes, but does anybody know what they are used to and is there an easy example which uses these classes? QtXml Module (http://doc.qt.nokia.com/latest/qtxml.html) QXmlStreamReader (http://doc.qt.nokia.com/4.7/qxmlstreamreader.html) QXmlStreamWriter (http://doc.qt.nokia.com/4.7/qxmlstreamreader.html) I've written a managed C++ code, but my problem is that this code (using /clr required) does not support IntelliSense in Visual Studio 2010. Now I try to