Get link/share url not working with DropBox?

Hi Daniele,

Many thanks for taking the time to reply in detail. I've implemented your suggestions but never get a non-blank link return. I had to add a iterations count to prevent the code going into an infinite loop. I'll take a look at the source code in more detail later on, but for now I'll keep working on the Google Drive option as it seems simpler and more reliable at this stage.

Thanks again,

Adam

procedure TForm1.ShareClick(Sender: TObject);
var
ci: TTMSFNCCloudItem ;
it: TTMSFNCCloudDropBoxItem;
iterations : integer ;
begin
ci := TTMSFNCCloudItem(TMSFNCCloudDemoListBox1.Items[TMSFNCCloudDemoListBox1.ItemIndex].DataObject) ;

if ( ci is TTMSFNCCloudDropBoxItem) then
begin
LinkStr := '';
iterations := 0 ;
Done := False;
TTMSFNCCloudDropBox(TMSFNCCloudStorageServices1.Storage).OnGetShare := GetShare;

repeat // 1
it := (TMSFNCCloudDemoListBox1.Items[TMSFNCCloudDemoListBox1.ItemIndex].DataObject) as TTMSFNCCloudDropBoxItem ;
TTMSFNCCloudDropBox(TMSFNCCloudStorageServices1.Storage).GetShare(it);

repeat // 2
  iterations := iterations + 1 ;
  Search_Box.Text := iterations.ToString ;
  Sleep(100);
  Application.ProcessMessages;
until Done  ;

until (LinkStr <> '' ) or (iterations > 100) ;
Link.text := LinkStr;
end;

if ( ci is TTMSFNCCloudGoogleDriveItem) then
Link.Text := (ci as TTMSFNCCloudGoogleDriveItem).WebContentLink ;

end;

procedure TForm1.GetShare(Sender: TObject; const AShare: string;
const ARequestResult: TTMSFNCCloudBaseRequestResult);
var
share_string : String ;
begin
share_string := AShare ;
LinkStr := share_string;
Done := True;
end;