FAQ Database Discussion Community


Delphi - Why am I getting this Access Violation? Is there a limit to ADOQuery parameteres?

delphi,access-violation,tadoquery
I have this code that is returning an Access Violation ('Access violation at address 74417E44 in module 'sqloledb.dll'. Read of address 786E3552') and I can't identify where is the problem. My only guess is that ADOQuery has a limit for the number of parameters we can pass. The code is...

C++ access violation when calling virtual method [closed]

c++,virtual,access-violation
Whenever I'm calling a virtual method in the GUIElement object, I'm getting an access violation exception. However, when calling "isFinished()", there's no exception. I'm using Visual Studio 2013. Here's my code: Some code of main.cpp: GUIElement* guiElement = NULL; void init() { guiElement = new GUIElement(&b); } void draw() {...

Error when TChart is docked

delphi,c++builder,access-violation,teechart,docking
I get an AV when I dock a Form, wich contains a TChart, into another Form. The error does not occure when the Autoaint property of the TChart is set to True. I have tested this with C++Builder XE6, XE7 and Delphi Builder XE6 with the standard version of TeeChart....

OpenCVSharp AccessViolationException in FindCirclesGrid

c#,opencv,access-violation,opencvsharp
I'm using OpenCVSharp to run some calibration tests but i can't seem to get FindCirclesGrid to work, i'm getting a really unexpected AccessViolationException when calling FindCirclesGrid. I'm not sure what i could be doing wrong as the first two line are pretty much exactly as in samples,centers is not initialized...

Can not catch an AccessViolationException

exception-handling,access-violation,google-text-to-speech
In my program I use a Google voice for text to speech by using an URL. But if my text is too long for Google, my program throws an AccessViolationException. This is the message it gives me: Attempted to read or write protected memory. This indicates that there are often...

C++ Creating Object Outside of Class

c++,class,object,access-violation
I am currently learning c++ and trying some stupid and simple things. Here is my class: class CRectangle { int x,y; public: // CRectangle(){}; int pb; int *ptr; void setValues(int,int); int* allocateArray(int); void changeVariable(CRectangle); friend void mett(); // !! ~CRectangle(); }; void CRectangle::setValues(int a, int b) { x = a;...

Access violation while reading in a multithreaded producer and consumer application

c,windows,multithreading,access-violation,release-mode
I have made a multi-threaded producer/consumer application which I have been struggling with for a couple of days now. The producer(s) place(s) Fibonacci numbers into a circular buffer and the consumer(s) take numbers from the buffer until the specified limit is reached. I have protected the circular buffer with a...

WriteFile throws Access Violation when 4th (optional) parameter is NULL

c++,winapi,visual-studio-2008,access-violation,writefile
Thought that it may be helpful to someone because it was a kind of surprise for me. WriteFile function tries to write into its 4th (optional) parameter, and if it is NULL it causes Access Violation exception... But not on Windows 8(.1). This is the function definition from msdn: BOOL...

Loading images with C++/SDL2 - “unhandled exception”, “access violation reading location”

c++,exception,visual-studio-2013,access-violation,sdl-2
I was studying someone else's Pong code for an earlier version of SDL, and I'm trying to get it running with SDL2. Below is an excerpt from my code, which only loads the images. When this code is run, I get a window popping up telling me this: Unhandled exception...

Access violation when “resizing” array in C++

c++,arrays,pointers,access-violation
So I'm trying to create a function that "resizes" a member array to a new size passed as an argument. By "resize", I mean that it should set the member array to a new array with the new size, copy over the elements from the old array, and then deallocate...

OpenGL, Access violation

c++,opengl,access-violation
I am making an OpenGL project in Visual Studio 2010. I am following a tutorial from youtube. I don't know where the error is, and I have this error: Unhandled exception at 0x00000000 in OpenGL First Game.exe: 0xC0000005: Access violation. Main.cpp #include <GL/glew.h> #include <iostream> #include <GL/glut.h> #include "Sprite.h" Sprite...

Casting literals to PChar / PAnsiChar

delphi,access-violation,c-strings
I've got really stupid question... Why this code: PChar('x'); causes "Access violation" error? Compiler optimalisation? Example: var s: String; ... s := StrPas(PAnsiChar('x')); This causes AV in Delphi 5 / Delphi XE Or this one: Windows.MessageBox(0, PChar('x'), PChar('y'), 0); This causes AV in Delphi 5, but not in Delphi XE...

Delphi Access Violation when moving button on form

delphi,button,access-violation
I am trying to move 2 buttons on the form using a while loop checking for the buttons left property, but I have an Access Violation. I am exeting the procedure with CreateThread() The code: procedure AnimButton1(); var ImageCount: integer; var b1, b2: integer; begin try while (b2 <> 187)...

CUDA memory access violation when creating an object in kernel function

c++,memory,cuda,access-violation,heap-memory
To allocate a large memory in CUDA kernel function using operator new I set the value of cudaLimitMallocHeapSize to the size of free device memory ~1.7-1.8G at every launch. But if I try to create an object in kernel function I get a memory access violation in the line i...

Looking for a cause of random EAccessViolation in SysUtils.Format / System.Move

delphi,access-violation
I'm (users of my application are) experiencing weird EAccessViolation errors with a piece of code having no bad programming logic. The DisplayData function simply sets the caption of a label - no compile time errors, no bad data send to the SysUtils.Format() function. MadExcept call stack looks like: main thread...