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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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 said:
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]
- (e-mail address removed)

MilanB said:
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
 
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]
- (e-mail address removed)

MilanB said:
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 said:
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]
- (e-mail address removed)

MilanB said:
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
 
Back
Top