473,322 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 1706
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.com

"MilanB" <Mi****@discussions.microsoft.comwrote in message
news:DB**********************************@microsof t.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.com

"MilanB" <Mi****@discussions.microsoft.comwrote in message
news:DB**********************************@microsof t.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.com

"MilanB" <Mi****@discussions.microsoft.comwrote in message
news:37**********************************@microsof t.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.com

"MilanB" <Mi****@discussions.microsoft.comwrote in message
news:DB**********************************@microso ft.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
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,...
1
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...
27
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,...
9
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
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...
4
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
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...
4
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...
23
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.