Debugging a run program in VB

  • Thread starter Thread starter John
  • Start date Start date
J

John

I was running a simple calculator program in
visualbasic.net 2002 with a windows applications on XP
Home, when this message popup as a Microsoft Development
Environment box and said following:
Attaching the .NET debugger to process'[####] Take-home
pay calculator.exe' on machine 'name of my machine'
failed. Error code 0x80004002.

If anyway could direct me in solving this problem, it
would help me very much. Thank you
 
John,
My best guess is that your calculator program threw an exception. You
probably have just-in-time debugging turned on, but when the code which
brings up the debugger on exceptions got fired, it, too, encountered an
error. In this case, 0x80004002 is E_OUTOFMEMORY -- "Out of memory," which
would explain why both the calculator program and the debugger failed.
(And then once both shut down, you regained enough memory to keep the rest
of the system going.) Perhaps your calulcator program has a memory problem
(that would seem the most likely, if everything else kept working after it
shut itself down); you might check from that angle first.

Let us know how it goes!

--Matt Gertz--*
VB Team
 
Hi Matt,

Thanks for the recommandation for my problem, but I am pretty much as a
novice in interrupting computer language. Are there ways that I can
find this problem by going through the menu or toolbar paths of my VB,
or should try going through the start menu. If so, what paths do you
consider I should go down. Thanks.

John
 
With a problem like this, the best approach is to step through it in Visual
Studio, since low memory situations are difficult to debug by attaching to
existing processes -- F5 to run to a breakpoint near where you think the
problem must occur, and then start stepping. (I'm assuming that you wrote
the calculator program, or at least have access to the code. If not,
you'll need to drag in the calculator code's author in to look at it, since
otherwise you can't grok what's going on unless you enjoy analyzing reams
of IL code :-)).

The web page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/htm
l/vxoriDebuggingManagedCode.asp contains a number of articles of how to
debug through managed code (such as VB code). Check it out and see if any
of it helps.

If it doesn't help, post another response and let me know, and I'll be
happy to suggest some pointers. (When you say "novice," do you mean you
are new to the VB programming language and new to debugging in general? If
so, please indicate that, and I'll tailor my comments to address that
angle.)

--Matt--*



--------------------
 
Hi Matt,

First, I didn't write this program; I download it from the website of
the textbook that I am learning VB from. Second, I try to go to the web
page that you recommand, but it could not be found. Third, I am new to
both VB programming language and debugging. I hope that you have the
patient in leading me through this situation, if so, I will be very
grateful. Thanks.

John
 
Back
Top