CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    15

    Handling GPF thru code





    Hi,

    Is there any way by which I could trap the GPFerror messages through VB

    code?

    Please help me find this out.

    Any suggestion would be appreciated?

    Any reading material / web site / book?????????


    Thanks in anticipation.

    Regards,

    Purnima

    [email protected]



  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Handling GPF thru code



    Hi


    Unfortunately, there is no way of trapping a GPF in VB (just like in any other programming language). These are usually caused by references to memory that isn't there anymore, or references to memory out of scope by that object.


    I spent an age trying to track down a GPF in one of our applications, it turned out that a UserControl was keeping a reference to an Object that had been passed into it - UserControl_Terminate cannot always be relied upon to clear down the references, hence the application would keep an invalid reference count and eventually go belly-up.


    I've got the Numega Developement tools installed on my machine here, they do a pretty good job of tracking down errors such as this. There's also supposed to be some very strong error trapping (I don't know whether it would handle this kind of error though).


    If you're feeling really brave, you can switch off all compiler options, and generate debugging symbolic code in VB which will allow you to trace the application in the Visual Studio debugger - not for the faint of heart though.


    Good Luck


    Chris Eastwood


    CodeGuru - the website for developers

    http://www.codeguru.com/vb



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