473,469 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
7 3129
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rune | last post by:
Hi, I've written a very simple 'kill-server' to help me shut down processes through Telnet or HTTP. The kill-server is a function and is launched as a thread. I use the module socket.py on Python...
0
by: seth | last post by:
Last week I encountered an AttributeError in my unit tests that I wasn'table to catch with an "except AttributeError" statement. The problem stemmed from a class that raised an error inside...
4
by: Nicolas Fleury | last post by:
Hi, I've made a small utility to re-raise an exception with the same stack as before with additional information in it. Since I want to keep the same exception type and that some types have very...
1
by: Old Wolf | last post by:
1. What is the difference between #include <stdexcept> and #include <exception> ? 2. Is there a list somewhere of what each standard exception is used for? either to throw them, or throw...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
7
by: ZorpiedoMan | last post by:
Well, I'm still wondering around in the "land of the lost exception"... It seems that controls that are bound to a class and the class throws an error in the SET method of the bound member, the...
3
by: JohnDeHope3 | last post by:
First let me say that I understand that Asp.Net wraps my exception in an HttpUnhandledException. I have found a lot of discussion about that on the web, which was informative, but not helpful. Let...
1
by: paul.hine | last post by:
Hello, I maintain an application that pulls data from a web service and writes it to an Excel sheet. Originally, the app used OleDb to write the Excel. Exports ran fine except that some text...
2
by: Darko Miletic | last post by:
Recently I wrote a dll in c++ and to simplify the distribution I decided to link with multithreaded static library (/MT or /MTd option). In debug everything works fine but in release I get this: ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.