NetReceiveNSetRequest Example for C++ 6.0 or later
void CDicomNetSink::OnNetReceiveNSetRequest(long hNet, short nPresentationID, short nMessageID, LPCTSTR pszClass, LPCTSTR pszInstance, long hDS)
{
//The Server receives a N-Set request and sends a N-Set response to the client
//
//In this example:
//1. m_LEADRasterView1, m_LEADRasterView2 are LEAD ActiveX Raster View (CLEADRasterView)
//
//2. m_pLEADDicomNet is LEAD DicomNet COM object (ILEADDicomNet *m_pLEADDicomNet)
//
//3. m_nClientOrServer: can be (STATUS_NONE, STATUS_SERVER, STATUS_CLIENT)
// identifieds the LMyDicomNet object as a server or a client
//4. m_nDataCommand: can be (COMMAND_C_MOVE,COMMAND_C_GET)
// set so the server knows how a C-Store Response was generated
//
//5. A connection exists between client and server
//6. An association exists between the client and server
CString strMsg;
_bstr_t strPeerAddress = m_pDlg->m_pLEADDicomNet->GetPeerAddress ( hNet);
strMsg.Format("*** OnNetReceiveNSetRequest ***\nPeer[%s]\nnPresentationID[%d]\nnMessageID[%d]\npszClass[%s]\npszInstance[%s]\nhDS[%x]\n",
(char *)strPeerAddress,
nPresentationID,
nMessageID,
pszClass,
pszInstance,
hDS);
//...
//...The server should change the values of the requested SOP Instance
//...to the values specefied in the data set elements in pDS
//...This function should search all the managed SOP Instances for a
//...match, and then change the requested elements.
//...
//...nStatus = status of the the above--assume DICOM_SUCCESS
//...
short nStatus = COMMAND_STATUS_SUCCESS;
m_pDlg->m_pLEADDicomNet->SendNSetResponse(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nStatus, hDS);
strMsg = strMsg + "SendNSetResponse\n";
AfxMessageBox(strMsg);
}