Re: [Quickfix-developers] Function problem in vb.net
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2006-11-15 15:35:11
|
> I'm just guessing here, but I'd guess the onCreate call is probably > running on your main thread (you instantiate a QF Application- > derived object, which creates the sessions, which call the > "onCreate" callback), while the onLogout is coming from the > internal QF socket thread (this is an asynchronous callback). The > first one works because you are in the "main" or "GUI" thread, > while the second one fails because you are on a different thread. Bingo. Likewise toApp is called from the thread sendToTarget was called from, and fromApp is called from the QuickFIX thread. But this and the above scenario isn't always the case (think poll and block instead of start), and this behavior might not always be the case in the future (possible addition of a sending thread in the future). So really in a forms app I would always recommend using Invoke and InvokeRequired when updating a control from a QuickFIX callback. --oren |