Significance of AssociationClosed Event
The AssociationClosed Event is provided in both COM & .NET versions, but by default disabled.
Should I use AssociationClosed Event ?
The reason why we do not encourage developers to use this event is that it is very easy for people to misuse it. A typical and very common mistake is assuming the end of one association is the end of transfer of one Study, or Series, etc. This is explained more fully in Some Systems Behave Badly when sent One Image Per Association
However, there are certain situations where AssociationClosed can/should be used, for example:
- Dicom Printing, where information should be dropped after each printing job has completed
- Simple gathering of information such as logging the total number of images transferred, or total bytes transferred through out the entire association.
To enable AssociationClosed event, one need to do the following:
DicomObjects.NET
DicomObjects.DicomGlobal.SetRegWord("DisableAssociationClosed", 0)
DicomObjects.COM:
So, in COM, if you need to use it you have to first enable it either by adding a real registry entry “DisableAssociationClosed” in the registry:
HKEY_LOCAL_MACHINE/Software/Medical Connections/DicomObjects/DisableAssociationClosed
or using DicomGlobal function:
Dim g As New DicomGlobal
g.RegWord("DisableAssociationClosed") = 0