Results 1 to 7 of 7

Thread: Error Handlers

  1. #1

    Thread Starter
    Addicted Member Guru's Avatar
    Join Date
    May 2000
    Location
    sulking in the cupboard under the stairs
    Posts
    237

    Error Handlers

    Using the usual On Error Goto Erhan type of thing how can I tell which line the error was in?

    I am debugging a DLL for an ASP and I don't want to add load of lines of code logging each line number to a file.

    thanks
    Another light-hearted post from Guru

  2. #2
    Hyperactive Member goatsucker's Avatar
    Join Date
    Dec 2002
    Location
    Leeds, England
    Posts
    283
    You could try running the DLL on your machine, and calling it through a VB test harness. That allows you to step through the code in debug mode. you must call up the DLLs vbp project and run it, and then run your test harness in another instance of the VB IDE. You can put a breakpoint in your DLL code and step through it as if it were an .exe

    Otherwise I don't think it can be done without adding debug code. However you could try this:

    http://www.sysinternals.com/ntw2k/fr...ebugview.shtml

    Whic allows you to view output from a dll (but you have to put it in the dll yourself).
    After all "Rust Never Sleeps"

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    You need to add line numbers in your code and then use the ERL statement in your error handler.

  4. #4
    Lively Member
    Join Date
    Sep 2002
    Posts
    89
    There are a couple of freeware line numbering addins that are available out there, and when my stupid network decides to return from where ever the hell it's gone, I'll post some code to do it...

    - gaffa

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    You can get a really excellent add-in from MZ-Tools. It's free and it gives you the ability to add and remove line numbers and much, much more. I've written a few add-ins but this one far surpasses anything that I've ever done.

  6. #6

    Thread Starter
    Addicted Member Guru's Avatar
    Join Date
    May 2000
    Location
    sulking in the cupboard under the stairs
    Posts
    237
    Thanks for the suggestions, I' thought about writing an addin to do the job but if one already exists then I'll give that a go.

    goatsucker
    Running in a test harness would be my usual technique but this one is hideously complicated!
    Another light-hearted post from Guru

  7. #7
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by MartinLiss
    You can get a really excellent add-in from MZ-Tools. It's free and it gives you the ability to add and remove line numbers and much, much more. I've written a few add-ins but this one far surpasses anything that I've ever done.
    Thanks, Martin!! I've always wanted most of those features!!
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width