Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
GeneralRe: Translating an "error event" to a managed exception Pin
OriginalGriff5-Mar-14 4:38
mveOriginalGriff5-Mar-14 4:38 
GeneralRe: Translating an "error event" to a managed exception Pin
Ravi Bhavnani5-Mar-14 4:46
professionalRavi Bhavnani5-Mar-14 4:46 
GeneralRe: Translating an "error event" to a managed exception Pin
OriginalGriff5-Mar-14 5:13
mveOriginalGriff5-Mar-14 5:13 
GeneralRe: Translating an "error event" to a managed exception Pin
BobJanova5-Mar-14 5:46
BobJanova5-Mar-14 5:46 
AnswerRe: Translating an "error event" to a managed exception Pin
Shameel5-Mar-14 5:07
professionalShameel5-Mar-14 5:07 
AnswerRe: Translating an "error event" to a managed exception Pin
BobJanova5-Mar-14 5:53
BobJanova5-Mar-14 5:53 
AnswerExceptions are exceptional Pin
Ennis Ray Lynch, Jr.5-Mar-14 8:58
Ennis Ray Lynch, Jr.5-Mar-14 8:58 
AnswerRe: Translating an "error event" to a managed exception Pin
jschell5-Mar-14 9:41
jschell5-Mar-14 9:41 
The concept is wrong.

An exception must propagate the call stack of a thread.

Presumably what you want is the following

public void Call3rdparty()
{
   try
   {
       Component.ErrorOccurred = MyErrorMethod;
       Component.CallMethod()
   }
   catch(SASException e)
   {

   }
}


The problem with the above is that there is no assurance that MyErrorMethod will be called in the same thread as Call3rdparty

This means that the call semantics are implicitly asynchronous and it must be handled that way.

I believe there are some handy classes in C#/Net that allows one to create a async call but it isn't that hard to write one yourself using a monitor (or whatever it is called), timeout and appropriate attributes. If creating it yourself
- Create a thread to call the method -
- Set a monitor, with timeout
- If thread returns then set a flag, and set monitor
- If error method is called set attribute that indicates error
- Once monitor clears (excluding timeout) then check attribute for error, if there is error then throw exception
GeneralRe: Translating an "error event" to a managed exception Pin
Bernhard Hiller5-Mar-14 20:17
Bernhard Hiller5-Mar-14 20:17 
QuestionPlease help me. don't working save button Pin
bayaa4-Mar-14 23:03
bayaa4-Mar-14 23:03 
SuggestionRe: Please help me. don't working save button Pin
Richard Deeming4-Mar-14 23:13
mveRichard Deeming4-Mar-14 23:13 
GeneralMessage Closed Pin
6-Mar-14 3:15
FesAlex6-Mar-14 3:15 
GeneralRe: Please help me. don't working save button Pin
Pete O'Hanlon6-Mar-14 3:32
mvePete O'Hanlon6-Mar-14 3:32 
GeneralRe: Please help me. don't working save button Pin
thatraja6-Mar-14 3:59
professionalthatraja6-Mar-14 3:59 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 16:09
bayaa6-Mar-14 16:09 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 16:10
bayaa6-Mar-14 16:10 
AnswerRe: Please help me. don't working save button Pin
Member 104046945-Mar-14 21:18
Member 104046945-Mar-14 21:18 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 15:55
bayaa6-Mar-14 15:55 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 19:29
bayaa6-Mar-14 19:29 
GeneralRe: Please help me. don't working save button Pin
bayaa6-Mar-14 19:52
bayaa6-Mar-14 19:52 
QuestionInheriting binding list Pin
Gilbert Consellado4-Mar-14 21:52
professionalGilbert Consellado4-Mar-14 21:52 
AnswerRe: Inheriting binding list Pin
BobJanova5-Mar-14 0:56
BobJanova5-Mar-14 0:56 
GeneralRe: Inheriting binding list Pin
Gilbert Consellado5-Mar-14 22:19
professionalGilbert Consellado5-Mar-14 22:19 
GeneralRe: Inheriting binding list Pin
Gilbert Consellado5-Mar-14 22:42
professionalGilbert Consellado5-Mar-14 22:42 
GeneralRe: Inheriting binding list Pin
BobJanova6-Mar-14 6:10
BobJanova6-Mar-14 6:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.