How to find line number of runtime error

Hi, after my program's execution, I got a window regarding a runtime error:

"Runtime error 216 at 00404466"

I know there's a way to decipher this into finding the source code line number where it occurred, but I don't know how to do it. Googling around it said to use the {$D+} compiler directive, but I'm not sure if I's supposed to place that in my DPR file or my main unit.
   Seems to me also that the IDE "Search"| "Find Error" option from the menu had something to do with it too... but for me, the "Find Error" option is disabled.

I'm using D7.

Thanks!
    Shawn
shawn857Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sinisa VukCommented:
Runtime error 216 = Access violation error
First thing is to go menu - Project\Options\Compiler - in Debugging check: Use debug DCUs + du full rebuild
... also Madshi's madExcept might help: similar EE topic
0
shawn857Author Commented:
OK did that... the "Find Error" menu option is still disabled however...

Thanks
   Shawn
0
Sinisa VukCommented:
Did you run app and go to the point of error?
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

MerijnBSr. Software EngineerCommented:
Find Error is only available when the application is running (and paused).
Start your app, go to Run -> Program Pause
Then Find Error will be available.

Please note that you'll only end up on the right address if the executable you are running from IDE is exactly the same is the executable which gave the original error!

Therefor I agree with Sinisa Vuk, it's easier and better to use a product like madExcept or Eurekalog.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Geert GOracle dbaCommented:
start the app with F8 ... this puts you directly in debugging mode
and then find error will work

same as MerijnB's approach ... :)
0
shawn857Author Commented:
OK guys, I think we have something now: it pointed to this procedure in the System unit:

procedure TObject.Free;
begin
  if Self <> nil then
    Destroy;
end;

.. in particular on the "Destroy" statement. So I guess this would mean that my problem is that somewhere in my code, I'm trying to free an object that doesn't need to be freed (or is already freed) ?

Thanks!
    Shawn
0
Sinisa VukCommented:
Could be. Which objects/components do you create in a run-time?
0
MerijnBSr. Software EngineerCommented:
It looks like you free an object which was already freed.

You can install the trial of Eurekalog (link in my previous post), it has detection for this. madExcept might as well.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.