Andrew Enfield
12/26/2002 6:00:00 AM
If I understand your question, I think the answer is that you don't have to
call EndInvoke. Box's Essential .NET says, on p194, that 'it is legal to
omit the call to EndInvoke if the results of the call are not important.'
It doesn't mention that memory leakage is a side-effect of not calling
EndInvoke.
Andrew
"BrianM" <mccorb@cox.net> wrote in message
news:OwhzAaJqCHA.2772@TK2MSFTNGP10...
> I have been reading about Invoke and BeginInvoke/EndInvoke. To relate it
to
> what I already know, Invoke looks like it can be used kind of like
> SendMessage() Win32 API and BeginInvoke/EndInvoke are (sort of) like
> PostMessage or the MFC PostThreadMessage.
>
> Here is my question. If I call BeginInvoke and do not maintain a reference
> to the returned IAsyncResult do I have to call EndInvoke. In other words,
If
> I want to emulate PostMessage and never care about the result of the
> operation, is calling EndInvoke required to keep memory from being
consumed?
>
>
> --
> Brian McCormick
> mccorb@cox.net
>
>