Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi - External exception C0000008 when application is run from within the IDE

Tags:

delphi

activex

When an application is run from within the IDE and the debugger is attached the exception 'External exception C0000008' is raised when it tries to connect to an imported ActiveX control.

If the application is ran standalone or the Rad Studio options/ Debugger Options/ Integrated debugging is unchecked, the program works as expected, no exception and the ActiveX control returns the expected result.

There are other ActiveX controls in the project, all of which work fine.

I have tried: - Reinstalling the ActiveX control - Re-Importing the ActiveX control - Removing any software that may be causing conflicts (experts/ plug-ins etc) - Turning off most running applications and services etc in case they are causing a conflict

Searching Google, It looks like others have been experiencing the same problem, but there is no fix to be found (other than turn off Integrated debugging, but obviously that is not a valid option.

Does any one have any ideas were to look to fix this problem?

I am using Delphi 2007

like image 751
Re0sless Avatar asked Oct 14 '10 15:10

Re0sless


1 Answers

C0000008 is the status returned for an invalid handle. Make sure that your wrapper when it goes to create the object gives it a proper handle and not nil (assuming it is crashing because of a windows handle).

Since the application runs fine when not attached to the debugger, I'm assuming that the wrapper is handling this condition gracefully so the error is most likely occurring inside a try/except block.

like image 138
skamradt Avatar answered Oct 02 '22 16:10

skamradt