GetPresentationResult Example for C++ 6.0 and later
{
int i;
int lResult;
CString strMsg, strTmp;
//create the Associate Class as Request
m_pLEADDicomNet->CreateAssociate (TRUE);
//set the Associate to the default
m_pLEADDicomNet->DefaultAssociate (m_pLEADDicomNet->GethPDU());
//get current results for each Presentation Context
strMsg = "Current Results";
for (i = 0; i < m_pLEADDicomNet->GetPresentationCount (m_pLEADDicomNet->GethPDU()); i++)
{
lResult = m_pLEADDicomNet->GetPresentationResult (m_pLEADDicomNet->GethPDU(), i);
strTmp.Format("\n[%d]", lResult);
strMsg = strMsg + strTmp;
}
AfxMessageBox(strMsg);
//change all results to 1
for (i = 0; i< m_pLEADDicomNet->GetPresentationCount (m_pLEADDicomNet->GethPDU()); i++)
{
m_pLEADDicomNet->SetPresentationResult (m_pLEADDicomNet->GethPDU(), i, 1);
}
//Display new results for each Presentation Context
strMsg = "New Results";
for (i = 0; i < m_pLEADDicomNet->GetPresentationCount (m_pLEADDicomNet->GethPDU()); i++)
{
lResult = m_pLEADDicomNet->GetPresentationResult (m_pLEADDicomNet->GethPDU(), i);
strTmp.Format("\n[%d]", lResult);
strMsg = strMsg + strTmp;
}
AfxMessageBox(strMsg);
m_pLEADDicomNet->FreeAssociate (m_pLEADDicomNet->GethPDU());
}