View Full Version : Access violations after removing DelphiX components

01-12-2009, 03:35 PM
System: Windows 7
Compiler/IDE: Delphi 7
Libraries/API: OpenGL, UnDelphiX

This problem's causing me a headache. I've been working on a personal game project for a couple of years and over time I've switched from DelphiX to plain OpenGL for my graphics and Fmod for my sound. However, I've kept on using DelphiX components (specifically TDXTimer and TDXInput) for convenience because I'm familiar with them. Today, though, I decided it was time to tidy up and replace them. I removed all references to them in the code, made sure nothing had the DelphiX units in the uses sections, and deleted the components. The program should, as far as I can tell, load all the models and sounds then sit at a blank screen as there's no timer to tell it to do anything.

Instead, though, it crashes with an Access Violation and Invalid Pointer Operation somewhere in my model loading code. I checked my backup copy and simply disabling the timer with all the DelphiX stuff left in gave the desired result - no crash. I thought this was pretty strange and after a bit of fruitless debugging and trial and error I found that the DelphiX-less version of my project can only run without crashing if there's a DXInput control on the form. Whether DXInput is in the uses section doesn't make a difference, only the control's presence seems to change anything. Just to reiterate, to get it to run without crashing all I have to do is place a DXInput on the forum without changing any values and without it being referenced anywhere in the entire project.

Anybody have a clue what's gone wrong?

01-12-2009, 04:30 PM
You can try moving your delphix source folder in some temporary location where compiler doesn't find it. That way you'd be sure none of your sub units refer to delphix.

However there is many things that can cause access violation in such case... try debugging it somehow.