By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

Can I attach an External Debug Window to My Running Executable?

P: n/a
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to
receive trace information for display in a window, or is there a third-party
tool?

TIA

Charles
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp

Ken
----------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to
receive trace information for display in a window, or is there a third-party
tool?

TIA

Charles

Nov 20 '05 #2

P: n/a
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed
on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp
Ken
----------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to receive trace information for display in a window, or is there a third-party tool?

TIA

Charles

Nov 20 '05 #3

P: n/a
Hi,

Maybe this will help.
http://www.codeguru.com/vb/gen/vb_sy...cle.php/c7525/

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

Ken
-------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:Ol**************@TK2MSFTNGP09.phx.gbl...
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed
on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp
Ken
----------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to receive trace information for display in a window, or is there a third-party tool?

TIA

Charles


Nov 20 '05 #4

P: n/a
Hi Ken

The codeguru article looks like just the job. Thanks.

Charles
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:er**************@tk2msftngp13.phx.gbl...
Hi,

Maybe this will help.
http://www.codeguru.com/vb/gen/vb_sy...cle.php/c7525/

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

Ken
-------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:Ol**************@TK2MSFTNGP09.phx.gbl...
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp

Ken
----------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Suppose my application is running on a client machine, and they report an intermittent problem. It only occurs after the program has been running

for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a third-party program), load it onto the client machine - without stopping

the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application

to
receive trace information for display in a window, or is there a

third-party
tool?

TIA

Charles


Nov 20 '05 #5

P: n/a

The following works with the standart output:

in your app.exe.config file add
<system.diagnostics>
<switches>
<add name="myTraceFlag1" value="0"/>
</switches>
</system.diagnostics>

When the customer have a problem, tell him to change the value, e.g
<add name="myTraceFlag" value="4"/>

value options:
0 none TraceSwitch is disabled.
1 TraceError: Only Errors.
2 TraceWarning: Errors and Warnings.
3 TraceInformation: Errors, Warnings, and Info.
4 TraceVerbose: All kinds of messages are traced.
No filter is applied.

' in your application add the following code:
Dim tl As New TextWriterTraceListener(System.Console.Out)
Trace.Listeners.Add(tl)

' Use Trace.WriteLineIf :
dim ts As New TraceSwitch("myTraceFlag1", "description")
Trace.WriteLineIf(ts.TraceInfo, myStrStatus)
Trace.WriteLineIf(ts.TraceWarning, myStrStatus)
Run your application using stdOutput:
myApp.exe > myWarnings.txt

and you will get your Trace lines in "myWarnings.txt" file

Atara



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6

P: n/a
Thanks Atara. A neat solution.

Charles
"Atara" <At***@DD.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

The following works with the standart output:

in your app.exe.config file add
<system.diagnostics>
<switches>
<add name="myTraceFlag1" value="0"/>
</switches>
</system.diagnostics>

When the customer have a problem, tell him to change the value, e.g
<add name="myTraceFlag" value="4"/>

value options:
0 none TraceSwitch is disabled.
1 TraceError: Only Errors.
2 TraceWarning: Errors and Warnings.
3 TraceInformation: Errors, Warnings, and Info.
4 TraceVerbose: All kinds of messages are traced.
No filter is applied.

' in your application add the following code:
Dim tl As New TextWriterTraceListener(System.Console.Out)
Trace.Listeners.Add(tl)

' Use Trace.WriteLineIf :
dim ts As New TraceSwitch("myTraceFlag1", "description")
Trace.WriteLineIf(ts.TraceInfo, myStrStatus)
Trace.WriteLineIf(ts.TraceWarning, myStrStatus)
Run your application using stdOutput:
myApp.exe > myWarnings.txt

and you will get your Trace lines in "myWarnings.txt" file

Atara



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.