Enumerating Digital Signatures Example for C++ 6.0 and later
void EnumerateSignatures(ILEADDicomDSPtr& spDicomDS)
{
// We will enumerate the Digital Signatures in the main Data Set
spDicomDS->SetCurrentElement (0);
long lSignaturesCount = spDicomDS->GetSignaturesCount();
if (lSignaturesCount == 0)
{
::MessageBox(NULL,
"No Digital Signatures in the main Data Set.",
"Sample",
MB_OK);
return;
}
char szMsg[128];
if (lSignaturesCount == 1)
{
lstrcpy(szMsg,
"There is 1 Digital Signature in the main Data Set. "
"Do you want to examine it?");
}
else
{
wsprintf(szMsg,
"There are %ld Digital Signatures in the main Data Set. "
"Do you want to examine them?", lSignaturesCount);
}
if (::MessageBox(NULL, szMsg, "Sample", MB_YESNO) != IDYES)
{
return;
}
for (long i = 0; i < lSignaturesCount; i++)
{
spDicomDS->MoveSignature(i);
// Refer to Examining a Digital Signature Example for C++ 6.0 and later
// for the function ExamineSignature
ExamineSignature(spDicomDS, spDicomDS->GetCurrentElement()->hElement);
spDicomDS->SetCurrentElement (0);
}
}