Page 1 of 1

C++ Builder 10.3 cannot create some events

Posted: Mon 08 Jun 2020 13:27
by RobinP
Hi, I've just downloaded the trial version of SecureBridge (sbridge26.exe) and am using it with C++ Builder 10.3. I've managed to get the basic file upload working which is all I need, but cannot create some of the events. When I try to create the event I get the message "Incorrect method declaration" from the IDE. It looks like something to do with the use of TArray which is being used in the event handler function signature, but is not being set up with the correct C++ syntax. E.g. for the TScSFTPClient OnSuccess event I get the following:

Code: Select all

ScSFTPClientSuccess(TObject *Sender, TScSFTPOperation Operation, const UnicodeString FileName,
          const TArray<System.Byte> Handle, const UnicodeString Message);
A similar thing happens for some other events as well, such as OnError/AfterWriteData etc.

Re: C++ Builder 10.3 cannot create some events

Posted: Fri 12 Jun 2020 09:15
by ViktorV
This is a known problem of the C++ Builder compiler, and we can't influence it. As a workaround, you can change TArray<System.Byte> to TBytes and assign the event handler in code at run-time instead of assigning it at design-time.

Re: C++ Builder 10.3 cannot create some events

Posted: Fri 12 Jun 2020 12:17
by RobinP
Ok thx that works.

Re: C++ Builder 10.3 cannot create some events

Posted: Fri 19 Jun 2020 06:32
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.