[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BrianM

12/21/2002 4:14:00 AM

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


1 Answer

Andrew Enfield

12/26/2002 6:00:00 AM

0


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
>
>