CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    651

    Error Line Numbers

    Is there an easy way to display the Line Number of where an error occurred? I'm debugging an application, but I can't run the app in the environment. I build the dll and use the dll in another application. I'm trying to figure out where the error is occurring in the dll without being able to set breakpoints and stepping through the code.

    I have tried using CurrentStack.GetFrame(0).GetFileLineNumber, but it always returns a 0.

    Any help would be greatly appreciated.
    I'd rather be wakeboarding...

  2. #2
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,452

    Re: Error Line Numbers

    Try this. Open your app, not the .DLL, then select "FILE", "ADD", "EXISTING PROJECT". Go find your .DLL project and select it to add it to a solution.

    Change the reference in your app to reference the Project instead of the .DLL There is a tab for projects when go to add a reference.

    From that point on, you can debug both the APP and the .DLL.

    Hope this helps.

  3. #3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    651

    Re: Error Line Numbers

    Quote Originally Posted by sotoasty
    Try this. Open your app, not the .DLL, then select "FILE", "ADD", "EXISTING PROJECT". Go find your .DLL project and select it to add it to a solution.

    Change the reference in your app to reference the Project instead of the .DLL There is a tab for projects when go to add a reference.

    From that point on, you can debug both the APP and the .DLL.

    Hope this helps.
    The dll project that I need is in a solution with many other projects and I can't bring in just the one I need without getting the rest. Then there's issues with services and such that I don't understand. I have to work with it the way I explained in my first post.

    Do you know how I can display line numbers in my error messages?
    I'd rather be wakeboarding...

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

Featured