Re: write delegate & callback in dll
- From: v-kevy@xxxxxxxxxxxxxxxxxxxx (Kevin Yu [MSFT])
- Date: Tue, 25 Jul 2006 05:39:07 GMT
Hi James,
So you mean you need to return the value from _Add function that is
calculated on another thread to the main thread. Am I right?
To return the value, the simplest way is to set the value to a certain
variable in the _Add function instead of returning a value. And in the
callback, make the main thread read from that variable. By the way, when
setting the variable value, we have to use SyncLock statement to lock the
object to make sure that no other thread is writing to it simultanously.
For more information about SyncLock, please check the following link:
http://msdn2.microsoft.com/en-us/library/3a86s51t.aspx
If anything is unclear, please feel free to let me know.
Kevin Yu
Microsoft Online Community Support
==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
.
- Follow-Ups:
- Re: write delegate & callback in dll
- From: James Wong
- Re: write delegate & callback in dll
- References:
- write delegate & callback in dll
- From: James Wong
- Re: write delegate & callback in dll
- From: guy
- write delegate & callback in dll
- Prev by Date: Re: Truncated ouput
- Next by Date: RE: Filecopy to network share
- Previous by thread: Re: write delegate & callback in dll
- Next by thread: Re: write delegate & callback in dll
- Index(es):