Jump to content

EugeneK

Members
  • Content Count

    66
  • Joined

  • Last visited

Everything posted by EugeneK

  1. EugeneK

    Component color in design time

    Hi Say I have following simple component, in runtime it shows it as blue, but in design time in has default color, how to fix it? unit UTestPanel; interface uses System.Classes, Vcl.Controls, Vcl.ExtCtrls; type TBluePanel = class(TPanel) strict private FPanel: TPanel; public constructor Create(AOwner: TComponent); override; end; procedure Register; implementation uses System.UITypes, Vcl.Forms; constructor TBluePanel.Create(AOwner: TComponent); begin inherited; FPanel := TPanel.Create(Self); FPanel.Parent := Self; FPanel.Align := alClient; FPanel.ParentBackground := False; FPanel.ParentColor := False; FPanel.Color := TColors.Blue; end; procedure Register; begin RegisterComponents('TestObjects', [TBluePanel]); end; end.
  2. Drop TBluetooth on form and check PairedDevices property.
  3. Right now code for TSocket.Send is following { Return -1 if error, else return number of byte written } function TCustomWSocket.Send(Data : TWSocketData; Len : Integer) : Integer; begin if (FState <> wsConnected) and (FState <> wsSocksConnected) then begin WSocket_Synchronized_WSASetLastError(WSAENOTCONN); SocketError('Send'); Result := -1; Exit; end; bAllSent := FALSE; if Len <= 0 then Result := 0 else begin Result := Len; PutDataInSendBuffer(Data, Len); end; if bAllSent then Exit; TryToSend; So actual sending is happens TryToSend and if it fails result is not -1 but number of bytes written, which is confusing, because it implies that Send was successful. Can we change it to something like if not TryToSend then Result := -1;
  4. EugeneK

    TSocket.Send result

    Yes, but it is a different conversation. I'm just saying if you know that something went wrong it is better to return error and let user handle it than return total length of data have or have not been sent, implying a success.
  5. EugeneK

    TSocket.Send result

    Why do you check for it then? This is from TryToSend, which is called from Send, this is exactly what happens, maybe it does not happen always, but that does not mean it never happens. Count := RealSend(Data, Len); if Count > 0 then begin Dec(FBufferedByteCount, Count); if FBufferedByteCount < 0 then FBufferedByteCount := 0; FWriteCount := FWriteCount + Count; { V8.30 was in RealSend } end; if Count = 0 then break; // Closed by remote if Count = SOCKET_ERROR then begin
  6. EugeneK

    TSocket.Send result

    What happens is that client drops connection but on my side I don't know it so State is still wsConnected and initial check in at the start of Send does not return failure, actual call to sendto inside TryToSend returns error and closes session, but Send still returns number of bytes written. I have to call Connect again in this case which clears buffer so I don't see how it will be sent twice. I handle OnSessionClosed right now, just will be more convenient to see it as result of Send right away.
  7. EugeneK

    TSocket.Send result

    Success is asynchronous, failure you can see right away if sendto returns error, just trying to make code simpler.
  8. Hi In latest revision of OverbyteIcsHttpProt.pas this line TypInfo, { V8.71 JK } needs to be changed to {$IFDEF RTL_NAMESPACES}System.TypInfo{$ELSE}TypInfo{$ENDIF},
  9. EugeneK

    How to draw a semitransparent ellipse on a canvas?

    You can easily do it with Direct2D // ... uses Winapi.D2D1, Vcl.Direct2D; // ... procedure TForm1.Button3Click(Sender: TObject); begin if (TDirect2DCanvas.Supported) then begin var D2DCanvas := TDirect2DCanvas.Create(Canvas, ClientRect); try D2DCanvas.Font.Assign(Font); D2DCanvas.RenderTarget.BeginDraw; D2DCanvas.RenderTarget.SetAntialiasMode(D2D1_ANTIALIAS_MODE_PER_PRIMITIVE); D2DCanvas.Brush.Color := clRed; D2DCanvas.Brush.Handle.SetOpacity(0.5); D2DCanvas.Ellipse(10, 10, 200, 200); D2DCanvas.RenderTarget.EndDraw; finally D2DCanvas.Free; end; end end;
  10. EugeneK

    GetIt servers down?

    Hi Is anyone able to use GetIt in 11.3 (online installer), I have following error
  11. EugeneK

    GetIt servers down?

    Yes it was temporary issue, works now.
  12. Hi We now have method to sending TBytes in socket, can we have the same for receiving?
  13. EugeneK

    Receiving TBytes

    Hi I wonder what is the need for MaxLen parameter? There is no such logic in ReceiveStr functions, if there is more data than MaxLen is it discarded or you can receive it in next call?
  14. EugeneK

    Receiving TBytes

    Hi Can we also have function that returns TBytes? It is more convenient in many cases
  15. Hi Anyone else has issue with Crowdstrike killing Delphi process when you start debugging? It happens when it stops on breakpoint and then when I try to continue it shows error and kills bds.exe. Seems to happen only on one of my projects but not on other ones.
  16. My problem is not in what OAuth unit uses, it is in what units use OAuth. If I just have THttpServer in my project OAuth should not be compiled in it, it is some dependency bloat.
  17. Is not it client only functionality? I noticed if I just have THttpServer in the project this unit is still somehow included.
  18. There is a problem in OverbyteIcsOAuthFormVcl, missing namespace WebView2, Winapi.ActiveX, Vcl.Edge, Vcl.OleCtrls, needs to be Winapi.WebView2, Winapi.ActiveX, Vcl.Edge, Vcl.OleCtrls,
  19. EugeneK

    Smartinspect status

    Hi Does anyone knows what is the status of Smartinspect? Last update on code partners site is from November 2020 that it is almost ready, but it is still not available.
  20. Hi I made a patch to use System.Zlib instead of OverbyteIcsZLibObj to avoid duplicating zlib code in application. ICSZlib.patch
  21. It is for XE2+ right now, i.e.. {$IFDEF DELPHI16_UP} {$DEFINE UseDelphiZlib} {$ENDIF} For Delphi 11, should be changed to DELPHI28_UP, not sure, how to check for Delphi 11.1
  22. Hi Any chance of adding TCustomWSocket.Send(const Data: TBytes) and/or marking function TCustomWSocket.SendStr(const Str : UnicodeString) : Integer; as deprecated to prevent inadvertent use of wrong encoding.
  23. Hi Can anyone login to quality.embarcadero.com? It stopped letting me in, even though I can login to my.embarcadero.com with the same credentials
  24. EugeneK

    Forum for Spring4D

    Same for me, shows as banned content on google.
  25. Hi Does anyone have experience using TFDEventAlerter with MSSQL server? I'm trying to get notified when new records were added to certain table, pretty much copying logic from sample application, except using my own Queue and Service. Problem is that it works for some time then randomly stops, or sometimes does not even start working when application starts. Any suggestions how to track down this issue?
×