Click here to Skip to main content
15,890,506 members
Home / Discussions / C#
   

C#

 
AnswerRe: Accessing methods of a derived class (polymorphism) Pin
AspDotNetDev25-May-10 10:40
protectorAspDotNetDev25-May-10 10:40 
GeneralRe: Accessing methods of a derived class (polymorphism) Pin
Neo1010125-May-10 22:02
Neo1010125-May-10 22:02 
GeneralRe: Accessing methods of a derived class (polymorphism) Pin
AspDotNetDev25-May-10 23:09
protectorAspDotNetDev25-May-10 23:09 
GeneralRe: Accessing methods of a derived class (polymorphism) Pin
OriginalGriff25-May-10 23:41
mveOriginalGriff25-May-10 23:41 
AnswerRe: Accessing methods of a derived class (polymorphism) Pin
Bernhard Hiller25-May-10 21:59
Bernhard Hiller25-May-10 21:59 
GeneralRe: Accessing methods of a derived class (polymorphism) Pin
Neo1010125-May-10 22:08
Neo1010125-May-10 22:08 
GeneralRe: Accessing methods of a derived class (polymorphism) Pin
Bernhard Hiller27-May-10 0:17
Bernhard Hiller27-May-10 0:17 
QuestionArgumentOutOfRangeException (index not negative) on EndInvoke while calling asynchronious Pin
hoernchenmeister25-May-10 5:00
hoernchenmeister25-May-10 5:00 
Hi all,
I just recently stepped into a strange problem.
I am making async calls to a method that scans files for "strange stuff"


public delegate HandleCheckResult(long id);

private void GetResult(long id)
{
System.Threading.AutoResetEvent ev = new System.Threading.AutoResetEvent(true);
HandleVirusCheckResult proc = Scan;
IAsyncResult async = proc.BeginInvoke(id, HandleResult, ev);
ev.WaitOne();
}

private void HandleResult(IAsyncResult async)
{

HandleCheckResult proc = (HandleCheckResult)((System.Runtime.Remoting.Messaging.AsyncResult)async).AsyncDelegate;
retVal = proc.EndInvoke(async);

((System.Threading.AutoResetEvent)async.AsyncState).Set();

}

It looks somehow like the code fragment above.
Everything works fine in my win-form application, but now I ported it to a Windows Service and get ArgumentOutOfRangeException on the EndInvoke method...
(index out of range, should not be negative and smaller than the collection)

If anybody could be so kind and point me into a direction... I am somehow lost right now...

Thanks in advance,
cheers
Hoernchenmeister
AnswerRe: ArgumentOutOfRangeException (index not negative) on EndInvoke while calling asynchronious [modified] Pin
Alan N25-May-10 5:47
Alan N25-May-10 5:47 
GeneralRe: ArgumentOutOfRangeException (index not negative) on EndInvoke while calling asynchronious Pin
hoernchenmeister25-May-10 20:25
hoernchenmeister25-May-10 20:25 
QuestionError: Method Not found (using Invokemember) Pin
newbie_md25-May-10 4:36
newbie_md25-May-10 4:36 
AnswerRe: Error: Method Not found (using Invokemember) Pin
Alan N25-May-10 7:02
Alan N25-May-10 7:02 
QuestionObject Initializer?? Pin
AmbiguousName25-May-10 2:54
AmbiguousName25-May-10 2:54 
AnswerRe: Object Initializer?? Pin
Richard MacCutchan25-May-10 3:10
mveRichard MacCutchan25-May-10 3:10 
GeneralRe: Object Initializer?? Pin
David Skelly25-May-10 4:14
David Skelly25-May-10 4:14 
GeneralRe: Object Initializer?? Pin
Richard MacCutchan25-May-10 4:29
mveRichard MacCutchan25-May-10 4:29 
GeneralRe: Object Initializer?? Pin
Eddy Vluggen25-May-10 5:14
professionalEddy Vluggen25-May-10 5:14 
GeneralRe: Object Initializer?? Pin
Richard MacCutchan25-May-10 5:58
mveRichard MacCutchan25-May-10 5:58 
AnswerRe: Object Initializer?? Pin
Abhinav S25-May-10 3:22
Abhinav S25-May-10 3:22 
AnswerRe: Object Initializer?? Pin
David Skelly25-May-10 4:27
David Skelly25-May-10 4:27 
GeneralRe: Object Initializer?? Pin
AmbiguousName25-May-10 4:47
AmbiguousName25-May-10 4:47 
Questioncheck email Pin
michaelgr125-May-10 1:22
michaelgr125-May-10 1:22 
AnswerRe: check email Pin
Sebastian T Xavier25-May-10 1:25
Sebastian T Xavier25-May-10 1:25 
GeneralRe: check email Pin
michaelgr125-May-10 1:26
michaelgr125-May-10 1:26 
GeneralRe: check email Pin
#realJSOP25-May-10 2:34
mve#realJSOP25-May-10 2:34 

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.