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 "applicatio n 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 3160
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 "applicatio n 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 { DoDangerousThin gs(); } 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 "applicatio n 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 { DoDangerousThin gs(); } 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 "applicatio n 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 { DoDangerousThin gs(); } 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 "applicatio n 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 { DoDangerousThin gs(); } 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 { DoDangerousThin gs(); } 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.Exceptio n. 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 v2.3
(Windows)
I can use telnet host:port and enter the secret killword or
use a broser with http://host:port/secret_killword
The 'kill-server' validates the secret_killword and writes a file
|
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
__init__and defined a __del__ method to clean up resources. I then
discovered asimilar problem in the shelve module. This led me to two
importantdiscoveries:
1. Attributes defined in __init__ after an error is raised will not be
apart of the...
|
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 specific constructors
(which take, for example, more than one parameter), the only safe way I
have found to made it is by hacking the str representation:
import sys
|
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 user-defined exceptions
derived from them? (for example I have been deriving mine from
std::bad_alloc if there was a memory problem, or std::bad_exception
if there was some other problem)
3. Is it a good idea to make all user-defined exceptions derive...
|
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 user tasks should always be
included in a try/catch block that actually handles any exceptions that
occur (log the exception, display a message box, etc.).
2. Low-level operations that are used to carry out the high level tasks
| |
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 exception cannot be
caught. I have wrapped my entire application in all the global
exception handlers I can find, and still to no avail. In fact all the
Try/Catches and Exception event handlers are worthless...
Put on your advanced thinking...
|
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 me explain how my question
is different.
Second, let me say that I have two questions. One is an ASP.Net related
question. The other is a general System.Exception question. They are related
but also individual.
Okay here is my problem...
|
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 fields were truncated due
to the 255 character limit of the Jet Excel driver. To overcome this
limit, I decided to just generate CSV directly. This is where my
trouble began.
First I tried the StreamWriter class, implemented as per the "How to:
|
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:
parseMetadata.obj : error LNK2001: unresolved external symbol "public:
__thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ)
2>libcpmt.lib(string.obj) : error LNK2001: unresolved external symbol
"public: __thiscall...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 we have to send another system
| |