GetPresentationAbstract Example for C++ 6.0 and later
{
int i;
long lCount;
_bstr_t cStr;
int nID;
//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
cStr = "Presentation Contexts--Results";
lCount = m_pLEADDicomNet->GetPresentationCount (m_pLEADDicomNet->GethPDU());
for (i = 0; i<lCount; i++)
{
nID = m_pLEADDicomNet->GetPresentationID (m_pLEADDicomNet->GethPDU(),i);
_bstr_t sPresentationAbstract = m_pLEADDicomNet->GetPresentationAbstract (m_pLEADDicomNet->GethPDU(), nID);
cStr = cStr + "\n" + sPresentationAbstract;
}
AfxMessageBox(cStr);
//change first five abstracts
for (i = 0; i<lCount; i++)
{
nID = m_pLEADDicomNet->GetPresentationID (m_pLEADDicomNet->GethPDU(),i);
m_pLEADDicomNet->SetPresentationAbstract (m_pLEADDicomNet->GethPDU(), nID, UID_CR_IMAGE_STORAGE);
}
//redisplay
cStr = "Presentation Contexts--Results";
for (i = 0; i<lCount; i++)
{
nID = m_pLEADDicomNet->GetPresentationID (m_pLEADDicomNet->GethPDU(),i);
_bstr_t sPresentationAbstract = m_pLEADDicomNet->GetPresentationAbstract (m_pLEADDicomNet->GethPDU(), nID);
cStr = cStr + "\n" + sPresentationAbstract;
}
AfxMessageBox(cStr);
m_pLEADDicomNet->FreeAssociate (m_pLEADDicomNet->GethPDU());
}