Page 1 of 1

Invalid Class Typecast exception in Delphi 6

Posted: Thu 06 Feb 2020 13:33
by nikolaj.sofijski
Hello
I am trying to use Devart SecureBridge Trial version 9.2.4 26-Dec-19 for Delphi 6. My Delphi version is Enterprise 6.0 (Build 6.240) Update Pack 2. I am executing such code and when I call Request.GetResponse; I get an Invalid Class Typecast exception. I have found similar issue viewtopic.php?f=27&t=39783

code:

var
Request: TScHttpWebRequest;
Response: TScHttpWebResponse;
ResponseStr: string;
begin
Request := TScHttpWebRequest.Create('https://api.smsapi.pl/user.do');
try
Request.Method := rmGet;
Request.ContentType := 'application/json';
Request.Headers.Add('smsapi_username’,’xxx’);
Request.Headers.Add('smsapi_password’,’xxx’);
Request.Headers.Add('credits','1');
Request.Headers.Add('details','1');
Response := Request.GetResponse;
ResponseStr := Response.ReadAsString;
Response.Free;
finally
Request.Free;
end;

Re: Invalid Class Typecast exception in Delphi 6

Posted: Fri 07 Feb 2020 11:26
by ViktorV
Please try using the nightly build of SecureBridge Trial Edition for Delphi 6 that includes the fix, which can be downloaded at https://download.devart.com/dac/sbridge6_07_02_2020.exe and let us know the result.

Re: Invalid Class Typecast exception in Delphi 6

Posted: Mon 10 Feb 2020 07:20
by nikolaj.sofijski
Hello
thank you for your support. The attached build with fix work fine.

Thanks a lot.

Re: Invalid Class Typecast exception in Delphi 6

Posted: Mon 10 Feb 2020 15:22
by ViktorV
Thank you for the interest to our product.
It is good to see that the problem has been solved.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.