467,925 Members | 1,898 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

uncatchable exception?

cs
We have some code that walks the process tree on windows xp. It uses the
process class in system diagnostic as well as some dllimport calls to
kernel32.dll and ntdll.dll
We also have some code that talks on terminal services virtual channels
using wtsapi32.dll

What we have noticed is that after calling those methods several times
per minute in some cases or at least lots of times per hour all day long
will end up giving a "application has generated an exception that could
not be handled" dialog with a ok and cancel button. Tonight I have
researched and someone suggests using cordbg, so I will try that next.
What I am actually wondering is how can that error show up if I have
some huge TRY-CATCHES around any calls to those lines of code? I am
almost certain its those lines of code that make it fail because I
output to my logs before and after calling methods on those dlls and the
error always happens right after the log says its getting ready to call
one of those methods. So is there some special TRY-CATCH for dll imports
maybe? BTW if I do pass the wrong params or something to those methods I
do get a nice exception I can catch, its just sometimes that I get that
error that I can't do anything about!
Thanks,
Nov 17 '05 #1
  • viewed: 2931
Share:
7 Replies
I'm not sure if cordbg is going to help you if it's a release build?
What I would do is use adplus -crash to write a dump file and debug the
dump file in Windbg using SOS.dll extensions.

Here are some links to help you out

http://support.microsoft.com/default...;en-us;Q286350
http://msdn.microsoft.com/msdnmag/is...r/default.aspx

There is also good deal of information about Windbg and sos online.

Nov 17 '05 #2
cs
Joerg Jooss wrote:
cs wrote:

We have some code that walks the process tree on windows xp. It uses
the process class in system diagnostic as well as some dllimport
calls to kernel32.dll and ntdll.dll We also have some code that talks
on terminal services virtual channels using wtsapi32.dll

What we have noticed is that after calling those methods several
times per minute in some cases or at least lots of times per hour all
day long will end up giving a "application has generated an exception
that could not be handled" dialog with a ok and cancel button.
Tonight I have researched and someone suggests using cordbg, so I
will try that next. What I am actually wondering is how can that
error show up if I have some huge TRY-CATCHES around any calls to
those lines of code? I am almost certain its those lines of code that
make it fail because I output to my logs before and after calling
methods on those dlls and the error always happens right after the
log says its getting ready to call one of those methods. So is there
some special TRY-CATCH for dll imports maybe? BTW if I do pass the
wrong params or something to those methods I do get a nice exception
I can catch, its just sometimes that I get that error that I can't do
anything about!

Maybe you're dealing with a non-CLS-compliant exception. Do have a
general catch clause in your code as well, e.g. something like
try
{
DoDangerousThings();
}
catch
{
// Yada yada
}

Cheers,


I almost always have a catch(Exception ex) at the end of all my catches,
is it still necessary to have a catch without an exception in it?
Nov 17 '05 #3
cs
Joerg Jooss wrote:
cs wrote:

We have some code that walks the process tree on windows xp. It uses
the process class in system diagnostic as well as some dllimport
calls to kernel32.dll and ntdll.dll We also have some code that talks
on terminal services virtual channels using wtsapi32.dll

What we have noticed is that after calling those methods several
times per minute in some cases or at least lots of times per hour all
day long will end up giving a "application has generated an exception
that could not be handled" dialog with a ok and cancel button.
Tonight I have researched and someone suggests using cordbg, so I
will try that next. What I am actually wondering is how can that
error show up if I have some huge TRY-CATCHES around any calls to
those lines of code? I am almost certain its those lines of code that
make it fail because I output to my logs before and after calling
methods on those dlls and the error always happens right after the
log says its getting ready to call one of those methods. So is there
some special TRY-CATCH for dll imports maybe? BTW if I do pass the
wrong params or something to those methods I do get a nice exception
I can catch, its just sometimes that I get that error that I can't do
anything about!

Maybe you're dealing with a non-CLS-compliant exception. Do have a
general catch clause in your code as well, e.g. something like
try
{
DoDangerousThings();
}
catch
{
// Yada yada
}

Cheers,


I almost always have a catch(Exception ex) at the end of all my catches,
is it still necessary to have a catch without an exception in it?
Nov 17 '05 #4
cs
Joerg Jooss wrote:
cs wrote:

We have some code that walks the process tree on windows xp. It uses
the process class in system diagnostic as well as some dllimport
calls to kernel32.dll and ntdll.dll We also have some code that talks
on terminal services virtual channels using wtsapi32.dll

What we have noticed is that after calling those methods several
times per minute in some cases or at least lots of times per hour all
day long will end up giving a "application has generated an exception
that could not be handled" dialog with a ok and cancel button.
Tonight I have researched and someone suggests using cordbg, so I
will try that next. What I am actually wondering is how can that
error show up if I have some huge TRY-CATCHES around any calls to
those lines of code? I am almost certain its those lines of code that
make it fail because I output to my logs before and after calling
methods on those dlls and the error always happens right after the
log says its getting ready to call one of those methods. So is there
some special TRY-CATCH for dll imports maybe? BTW if I do pass the
wrong params or something to those methods I do get a nice exception
I can catch, its just sometimes that I get that error that I can't do
anything about!

Maybe you're dealing with a non-CLS-compliant exception. Do have a
general catch clause in your code as well, e.g. something like
try
{
DoDangerousThings();
}
catch
{
// Yada yada
}

Cheers,


I almost always have a catch(Exception ex) at the end of all my catches,
is it still necessary to have a catch without an exception in it?

Nov 17 '05 #5
cs
Joerg Jooss wrote:
cs wrote:

We have some code that walks the process tree on windows xp. It uses
the process class in system diagnostic as well as some dllimport
calls to kernel32.dll and ntdll.dll We also have some code that talks
on terminal services virtual channels using wtsapi32.dll

What we have noticed is that after calling those methods several
times per minute in some cases or at least lots of times per hour all
day long will end up giving a "application has generated an exception
that could not be handled" dialog with a ok and cancel button.
Tonight I have researched and someone suggests using cordbg, so I
will try that next. What I am actually wondering is how can that
error show up if I have some huge TRY-CATCHES around any calls to
those lines of code? I am almost certain its those lines of code that
make it fail because I output to my logs before and after calling
methods on those dlls and the error always happens right after the
log says its getting ready to call one of those methods. So is there
some special TRY-CATCH for dll imports maybe? BTW if I do pass the
wrong params or something to those methods I do get a nice exception
I can catch, its just sometimes that I get that error that I can't do
anything about!

Maybe you're dealing with a non-CLS-compliant exception. Do have a
general catch clause in your code as well, e.g. something like
try
{
DoDangerousThings();
}
catch
{
// Yada yada
}

Cheers,


I almost always have a catch(Exception ex) at the end of all my catches,
is it still necessary to have a catch without an exception in it?

Nov 17 '05 #6
> > Maybe you're dealing with a non-CLS-compliant exception. Do have a
general catch clause in your code as well, e.g. something like
try
{
DoDangerousThings();
}
catch
{
// Yada yada
}

Cheers,


I almost always have a catch(Exception ex) at the end of all my catches,
is it still necessary to have a catch without an exception in it?


Non-CLS compliant exceptions can only be thrown by code which is able to
generate native exceptions or exception not based on System.Exception. This
could be native code or also managed C++.
Nov 17 '05 #7
I guess you don't want to use adplus to find out what the exception is?

Nov 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Rune | last post: by
4 posts views Thread by Nicolas Fleury | last post: by
1 post views Thread by Old Wolf | last post: by
44 posts views Thread by craig | last post: by
7 posts views Thread by ZorpiedoMan | last post: by
3 posts views Thread by JohnDeHope3 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.