Page 1 of 1

Always Invalid Class Typecast (?)

Posted: Sun 19 Jan 2020 09:58
by TrackRanger
Hello
I am trying to use Devart SecureBridge version 9.2 for RadStudio 10.2

Everything I try results in an Invalid Class Typecast exception, including when I try many demonstrated existing samples, such as this.

Code: Select all

procedure TBM_System_Form.BMSocket2ConnectionBtnClick(Sender: TObject);
var
  Request: TScHttpWebRequest;
  Response: TScHttpWebResponse;
  ResponseStr: string;
  Buf: TBytes;
  URL : String;
begin
  try
  Request := TScHttpWebRequest.Create('https://esta.cbp.dhs.gov/esta/');
  try
    Response := Request.GetResponse;  // gives invalid typecast
    try
      ResponseStr := Response.ReadAsString;
      Memo1.Lines.Text := ResponseStr;
    finally
      Response.Free;
    end;
  finally
    Request.Free;
  end;

  except
    on E: Exception do
      begin
      Memo1.Lines.Add('GetTokenBtnClick. Error: '+E.ToString);
      end;
  end;

end; {procedure}
and also this, attempting to use SignalR with a TscHubConnection:

Code: Select all

procedure TBM_System_Form.BMConnect;
type
    SignalRClient: TScHubConnection;
...
begin
  SignalRClient.Url := BMHubConnS+','+'token='+AuthKey+'';
  SignalRClient.Register('gpsfeed', ProcessMsg, [varString]);
  SignalRClient.Start;  // <- gives invalid typecast
end;
I have tried using the various methods, settings and parameters. The program only ever responds with a fairly vague error of "Invalid Class Typecast"

Why wouldn't these samples work. I see others have had the same issues and reported them, but even the samples do not operate successfully on my testing. I appreciate any suggestions.

Re: Always Invalid Class Typecast (?)

Posted: Mon 20 Jan 2020 13:54
by ViktorV
Thank you for the information and your help on issue investigation. The issue investigation is in progress. We will inform you when we have any results.

Re: Always Invalid Class Typecast (?)

Posted: Wed 22 Jan 2020 13:18
by ViktorV
We've already fixed the issue, the fix will be included in the next version of SecureBridge.
We identified that such behavior is observed only in SecureBridge Trial Edition.
Please try using the nightly build of SecureBridge Trial Edition for RAD Studio RAD Studio 10.2.2 Tokyo that includes the fix, which can be downloaded at https://download.devart.com/dac/sbridge ... 1_2020.exe and let us know the result.