It all seems to work OK until I set SetEncryptionSerialNumber to anything other than 123456,
Does the SetEncryptionSerialNumber work at the current time?
The following code works fine and updates the status box's for 123456, but changing the value of Line to say 987129 and it appears to lock up showing
downloadstatus as 10 (in progress) then after a while will jump to 13 and 15 16 17
progress is stuck at 1
and terminationstatus finishes on 6 - dialogue error!
Any Ideas ? or am I missing something simple
Code: Select all
.........
...........
char Line[7] = "123456";
int i;
long Serial;
Serial = 0;
for (i = 0 ; Line[i] ; ++i)
{
Serial <<= 4;
Serial |= Line[i] & 0xf;
}
SetEncryptionSerialNumber(Serial);
unsigned short ReturnCode;
ReturnCode = StartDefinitionDownload("c:\RO08.TAB", 0, 40, 2);
if ( ReturnCode == START_DOWNLOAD_TRANSMISSION_STARTED)
{
// download started succesfully. The download thread is running
Timer1->Enabled=true;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
if ( DefinitionDownloadStatus(&DownloadStatus, &TerminationStatus, &Progress, &ProgressLimit) == DOWNLOAD_THREAD_RUNNING)
{
Box2->Value = DownloadStatus;
Box1->Value = Progress;
Box3->Value = TerminationStatus;
}
else
{
Box2->Value = DownloadStatus;
Box1->Value = Progress;
Box3->Value = TerminationStatus;
}
}
//---------------------------------------------------------------------------