Asynchronous Operations

A DicomConnection Object can be made to operate asynchronously. To do this you must first define a DicomServer (withevents) or a DicomViewer Object. Then use the DicomViewer\DicomServer's New method to create the asynchronous DicomConnection. e.g.

Set Connection = Viewer.New("DicomConnection")
 'The DicomConnetion is now asynchronous

Operations invoked by the connection object happen on a new background thread (asynchronously).

connection.Find.........
'The find operation occurs on a new background thread

The returned responses can then be picked up in the DicomViewer\DicomServer's ActionComplete and ActionUpdate events.

Note that it is very important not to attempt any other operations on the DicomConnection object prior to the ActionComplete event firing, as only one asynchronous operation may be queued at any time, so trying to fire a second operation whilst the first is still in operation will cause the second call not to return until the first operation has completed.

NOTE- In the .NET Version of DicomObjects this arrangement has been made obsolete as a result of the free threaded model. see Conversion_from_the_COM_version_of_DicomObjects_to_the_native_.NET_version

Relevance: