IsMaxLengthEnabled Example for C++ 6.0 and later
{
long lLen;
CString cStr;
//...Assume association has been created
//is max len enabled?
if (m_pLEADDicomNet->IsMaxLengthEnabled (m_pLEADDicomNet->GethPDU()) )
{
//disable it and display old value
lLen = m_pLEADDicomNet->GetMaxLength (m_pLEADDicomNet->GethPDU());
cStr.Format("Maximum Length Disabled: %d", lLen);
AfxMessageBox(cStr);
m_pLEADDicomNet->SetMaxLength (m_pLEADDicomNet->GethPDU(), FALSE, lLen);
}
else
{
//enable it
long lNewLen = 8;
m_pLEADDicomNet->SetMaxLength (m_pLEADDicomNet->GethPDU(), TRUE, lNewLen);
cStr.Format("Maximum Length Enabled: %d", lNewLen);
AfxMessageBox(cStr);
}
}