Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1155
  • Last Modified:

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
0
shawn857
Asked:
shawn857
  • 3
  • 2
  • 2
  • +1
1 Solution
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 
Geert GruwezOracle 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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now