access-violation

About the non-nullable types debate

允我心安 提交于 2019-12-29 08:35:39
问题 I keep hearing people talk about how non-nullable reference types would solve so many bugs and make programming so much easier. Even the creator of null calls it his billion dollar mistake, and Spec# has introduced non-nullable types to combat this problem. EDIT: Ignore my comment about Spec#. I misunderstood how it works. EDIT 2: I must be talking to the wrong people, I was really hoping for somebody to argue with :-) So I would guess, being in the minority, that I'm wrong, but I can't

Getting AccessViolation Exception when returning a bool from C++ to C#

て烟熏妆下的殇ゞ 提交于 2019-12-25 18:34:38
问题 I am using a third-party, proprietary DLL for which the source code is not available to me. Wrapper code that appears to have been auto-generated using SWIG 1.3.39 is, however, available to me. The wrapper code consists of a C++ file that compiles (using some headers that describe the DLL) to a DLL and of a C# project that makes PInvoke calls to the C++ wrapper DLL. After inspecting the StackTrace I got the following information: at org.doubango.tinyWRAP.tinyWRAPPINVOKE.MediaSessionMgr

EmguCV - Create image from unmanaged data

拜拜、爱过 提交于 2019-12-25 12:13:06
问题 I'm using EmguCV and i've got a byte type Grayscale Matrix with the size of 640x480 and Every element of the matrix is either 255 or 0. Now I need to make an Image from this. The best constructor I found looked like this: Image<Gray,byte>(int width, int height, int stride, IntPtr scan0) I got the first, second and fourth parameters from the matrix and I sent 640 for the stride. But it gives me an Access violation exception: Attempted to read or write protected memory. This is often an

EmguCV - Create image from unmanaged data

余生长醉 提交于 2019-12-25 12:11:37
问题 I'm using EmguCV and i've got a byte type Grayscale Matrix with the size of 640x480 and Every element of the matrix is either 255 or 0. Now I need to make an Image from this. The best constructor I found looked like this: Image<Gray,byte>(int width, int height, int stride, IntPtr scan0) I got the first, second and fourth parameters from the matrix and I sent 640 for the stride. But it gives me an Access violation exception: Attempted to read or write protected memory. This is often an

Pinning a Structure to avoid AccessViolationException

妖精的绣舞 提交于 2019-12-25 07:47:09
问题 I am calling an function from a DLL which is loaded run-time (Using LoadLibrary()). This DLL is written in C++ and my code is in C#. API requires Structure Pointer. I am passing "ref" instead of Pointer. While doing this, I getting "AccessViolationException". After 3 days of Googling, I think the problem could be solved by Pinning the Structure so that GC won't disturb it. (See: Passing struct by reference causing AccessViolationException) My question is Can I pin a structure without using

Access Violation inside inetinfo.exe when passing byte array through IMSAdminBase from a .NET app compiled to AnyCPU

余生长醉 提交于 2019-12-25 06:33:21
问题 Consider the following piece of .NET code: byte[] hash = { 0x60, 0x2B, 0x45, 0x9D, 0xA0, 0x6D, 0xD5, 0x02, 0x43, 0x86, 0xC1, 0xBA, 0x6B, 0x14, 0x37, 0x88, 0x63, 0x08, 0x39, 0xA0 }; using (var adminBase = TemporaryComObject.Wrap(new MSAdminBase_W())) using (var ptrHash = new AllocHGlobal(hash)) { using (var siteKey = new AdminBaseKey(adminBase.Com, adminBase.Com.OpenKey(METADATA_MASTER_ROOT_HANDLE, "/LM/W3SVC/1", METADATA_PERMISSION_READ | METADATA_PERMISSION_WRITE, 10000))) { var record = new

JNI exception access violation

。_饼干妹妹 提交于 2019-12-25 05:25:12
问题 at the moment i´m trying to play around with JNI. My Java-Code : public class test{ static{ System.loadLibrary("wakeup64"); } public static native boolean setWakeupTime(Date date); public static void set(){ Date d = new Date(); setWakeupTime(d); } } C-Code: #include <jni.h> #include "cpp_interface.h" #include <stdio.h> JNIEXPORT void JNICALL Java_test_setWakeupTime (JNIEnv *env, jclass cl, jobject date){ printf("test"); } int main(){ } The code compiles fine but if I run my java Class i´m

AccessViolationException outside Visual Studio?

别来无恙 提交于 2019-12-25 04:52:04
问题 I'm developing a small C# winforms application that consumes an unmanaged C++ library. I have no access to the code of this library. If I'm in Visual Studio and I runt my application, do my calls to the library everything is working find. Once I run CTRL + F5 I get an AccessViolationException. I did some testing, created another winforms application in .NET 2.0 (others were in .NET 4.0) and there I don't receive the AccessViolationException. So I thought i'd create a .net 2.0 class library in

AccessViolation when using C++ DLL from Delphi

こ雲淡風輕ζ 提交于 2019-12-25 04:07:17
问题 I have a weird problem trying to use a DLL written in C++ from a Delphi (Turbo Delphi 2006) program. When I run the Delphi program (see below) from the command line, everything works fine. Also, when I run it from the Delphi environment without debugging (CTRL+SHIFT+F9), everything is fine. However, when running it with debugging (F9), I get the following error: Project Z:\test.exe faulted with message: 'access violation at 0x00403fdf: read of address 0x00a14e74'. Process stopped. Use Step or

FaceDetect OpenCV2.1 sample, Access violation writing location 0x00000000

孤街浪徒 提交于 2019-12-25 01:07:14
问题 I try to run facedetect opencv sample with vs2010. debug result "Unhandled exception at 0x53fa42bf in facedetect.exe: 0xC0000005: Access violation writing location 0x00000000." Here is the code txt file: http://ebooks-libs.com/backup/facedetect-opencv2.1.txt cpp file: http://ebooks-libs.com/backup/facedetect.cpp #include "stdafx.h" #include <iostream> #include <cstdio> #define CV_NO_BACKWARD_COMPATIBILITY #include "cv.h" #include "highgui.h" #ifdef _EiC #define WIN32 #endif using namespace