Asynchronous Operation
- From: Harry Riddle <NetStream@xxxxxxxxxxxxxxxx>
- Date: Thu, 14 Apr 2005 10:06:02 -0700
I am launching an asynchronous subroutine from a button on a windows form
that contain synchronous routines. However, control is not being returned to
my interface until sometime later. It is not usually when all the
asynchronous processes have finished, but sometime in between. Is this
normal or what might I not be doing correctly?
This is what I am doing:
'defined in my form class
Public Delegate Sub GetCardInfoDelegate()
Private c1 As GetCardInfoDelegate
Private ar1 As IAsyncResult
Private cb1 As AsyncCallback = New AsyncCallback(AddressOf
GetCardInfoDone)
'code in a button-click routine
c1 = AddressOf GetCardInfo
ar1 = c1.BeginInvoke(cb1, Nothing)
'code to run when the async process has completed
Private Sub GetCardInfoDone(ByVal ar As IAsyncResult)
GetCardInfo2()
GetCardInfo3()
Me.StatusBarPanel1.Text = "Card Info Done"
c1.EndInvoke(ar)
End Sub
'code to run asynchronously
Private Sub GetCardInfo()
If inqMaint.CorpNumber <> inqMaint.CardNumber Then
LoadCardholderInformation(inqMaint.CardNumber)
lblCardAccount.Text = "Card Account #"
Else
LoadCorpholderInformation(inqMaint.CorpNumber)
lblCardAccount.Text = "Corporate Account"
End If
tCtrlr.SetStatus("Loading Corporate info...")
LoadCards(txtAccount.Text)
UpdateCaption(inqMaint.CardNumber)
tCtrlr.SetStatus("Loading POC Information...")
LoadPOCInfo(inqMaint.CorpNumber)
End Sub
--
Thanks,
Harry
.
- Follow-Ups:
- RE: Asynchronous Operation
- From: "Peter Huang" [MSFT]
- Re: Asynchronous Operation
- From: Patrick Steele [MVP]
- RE: Asynchronous Operation
- Prev by Date: Re: Databinding Combobox to Master/Detail DataGrids
- Next by Date: Re: How To Print A Form
- Previous by thread: Reinstalling .net 1.1
- Next by thread: Re: Asynchronous Operation
- Index(es):