473,792 Members | 3,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception is not shown, just function is exited???

Hello

I have C# code that normaly throw exception and error message is shown. It's
works fine.

Separatlely I have ATL Component.
When ATL Componenet fires event, and later C# code is called, no exception
is shown. Function is just exited and no error is shown.

Any help?

Thanks
Milan
Jul 1 '06 #1
3 1729
MilanB,

It's possible that the event firing mechanism is absorbing the
exception. You should put a try/catch block around the event handler code,
and then debug it to see if it indeed throws an exception.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"MilanB" <Mi****@discuss ions.microsoft. comwrote in message
news:DB******** *************** ***********@mic rosoft.com...
Hello

I have C# code that normaly throw exception and error message is shown.
It's
works fine.

Separatlely I have ATL Component.
When ATL Componenet fires event, and later C# code is called, no exception
is shown. Function is just exited and no error is shown.

Any help?

Thanks
Milan

Jul 2 '06 #2
Yes, when I put try/catch it is works well.
But I wished to know if there is some trick to get exception normaly,
because it can be an error, in this type code, without notifications.. .

Thanks again
Milan
"Nicholas Paldino [.NET/C# MVP]" wrote:
MilanB,

It's possible that the event firing mechanism is absorbing the
exception. You should put a try/catch block around the event handler code,
and then debug it to see if it indeed throws an exception.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"MilanB" <Mi****@discuss ions.microsoft. comwrote in message
news:DB******** *************** ***********@mic rosoft.com...
Hello

I have C# code that normaly throw exception and error message is shown.
It's
works fine.

Separatlely I have ATL Component.
When ATL Componenet fires event, and later C# code is called, no exception
is shown. Function is just exited and no error is shown.

Any help?

Thanks
Milan


Jul 2 '06 #3
Milan,

The code works fine, its just that when the event is fired, there is a
try/catch that the caller of the event places around your code, so that your
code doesn't bring their code down.

You just have to know to look for this when events dont fire that you
think should produce a result.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"MilanB" <Mi****@discuss ions.microsoft. comwrote in message
news:37******** *************** ***********@mic rosoft.com...
Yes, when I put try/catch it is works well.
But I wished to know if there is some trick to get exception normaly,
because it can be an error, in this type code, without notifications.. .

Thanks again
Milan
"Nicholas Paldino [.NET/C# MVP]" wrote:
>MilanB,

It's possible that the event firing mechanism is absorbing the
exception. You should put a try/catch block around the event handler
code,
and then debug it to see if it indeed throws an exception.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"MilanB" <Mi****@discuss ions.microsoft. comwrote in message
news:DB******* *************** ************@mi crosoft.com...
Hello

I have C# code that normaly throw exception and error message is shown.
It's
works fine.

Separatlely I have ATL Component.
When ATL Componenet fires event, and later C# code is called, no
exception
is shown. Function is just exited and no error is shown.

Any help?

Thanks
Milan



Jul 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3650
by: Scott J. Chlebove | last post by:
I am running a PL/SQL module in which I do the following.... BEGIN DBMS_OUTPUT.enable(1000000); -- Open file for writing. OutfileHandler1 := UTL_FILE.FOPEN(wc_file_path, wc_output_file1, 'W'); -- output report -- Get the CUSTOMER records by reading the CUSTOMER table.
1
1879
by: Andy | last post by:
Hi All, I'm basically just trying to get started with the Exception Management Application Block and am having some technical difficulties. All I want to do to begin with is create a simple Windows Application (which I have done and named "ExceptionManagementTester") and within it create and use a custom publisher. The Exception Management Tester Solution contains ONE project with these files:
27
3431
by: garyolsen | last post by:
In C++ what kind of unexpected conditions should be handled as exceptions? Besides dividing by 0, bad memory allocation, what're the most popular exceptions? When should not use exception, instead, use regular function returns? Thanks!
9
1329
by: chenchang | last post by:
Hi, experts. i write a simple program to test EH in G++: void throwfunction() { throw "test"; } class A { int i;
5
5751
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by thread.Abort()) is reported twice: once in the debug window, and once through the message box. Is it because the thread was sleeping when the exception occurred?
4
1419
by: koltti | last post by:
Hello, I have situation similar like this. class Class1{ private Class2 obj2; ... public bool method1(Class3 ob3j, DateTime dt){ try{ obj2.Method2(obj3, dt);
0
1708
by: pratika2002 | last post by:
Hi, I am having a windows service project which is built by someone else and I have to understand the fuctionality. While running the service I am getting the following exception. "An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll Additional information: Request for the permission of type System.Security.Permissions.RegistryPermission, mscorlib, Version=1.0.5000.0, Culture=neutral,...
4
1367
by: Stanislaw Tristan | last post by:
Problem: I created a custom exception that inherits from Exception and added a some of new properties. All new properties filled in the constructors. When I throwing this custom exception and go to the snapshot viewer the last shows only properties of Exceptions, the new properties are not shown. Question: How to show new properties of Exception-descendants in the snapshot viewer (such as, for example, SqlException shows Procedure, Line...
23
7240
by: TarheelsFan | last post by:
What happens whenever you throw an exception from within a constructor? Does the object just not get instantiated? Thanks for replies.
0
9669
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, 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...
0
9517
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,...
0
10207
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 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...
0
9997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9030
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, 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...
0
5435
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
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
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.