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, 7 3129
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?
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?
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?
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?
> > 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++.
I guess you don't want to use adplus to find out what the exception is? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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:
...
|
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...
|
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,...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |