InsertUID Example for C++Builder
int nRet;
AnsiString sOutput;
LEADDicom1->EnableMethodErrors = false;
nRet = LEADDicom1->FindUID("1.2.840.10008.1.3");
if(nRet == SUCCESS)
{
ShowMessage("Already Exists!");
return;
}
nRet = LEADDicom1->InsertUID("1.2.840.10008.1.3", "My Test UID");
if(nRet != SUCCESS)
{
ShowMessage("Error Number: " + IntToStr(LEADDicom1->Error));
return;
}
LEADDicom1->EnableMethodErrors = true;
try
{
/* add item to the ListView control */
sOutput = "UID Inserted:\n";
sOutput = sOutput + "Code: " + LEADDicom1->CurrentUID->Code + "\n";
sOutput = sOutput + "Name: " + LEADDicom1->CurrentUID->Name;
ShowMessage(sOutput);
}
catch(ELEADDicomError *e)
{
ShowMessage("Error Number: " + IntToStr(LEADDicom1->Error));
}