-
Content Count
2268 -
Joined
-
Last visited
-
Days Won
46
Everything posted by Fr0sT.Brutal
-
TCP server rejecting connections
Fr0sT.Brutal replied to DusMac's topic in ICS - Internet Component Suite
Check if the server rejects the very connections or just handshakes by telnet'ing to the host:port Is the server responsive when the issue occurs (i.e. if the message pump is active)? Does it listen on the port at all? Are you catching server's and clients' exceptions? -
mORMot is usually very good in perf optimization and they have their own JSON
-
https://github.com/Fr0sT-Brutal/awesome-pascal#database
-
TCP server rejecting connections
Fr0sT.Brutal replied to DusMac's topic in ICS - Internet Component Suite
The issue could be in dangling sockets - Windows keeps them for a while after closing. Ensure you have linger options disabled for server's client sockets https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-closesocket -
Is it possible to make changes to the source code for reserved words?
Fr0sT.Brutal replied to Al T's topic in Delphi IDE and APIs
The only way is to get employed in Emba's compiler dev team, they have sources 🙂 -
I Broke Delphi ->> Low bound exceeds high bound & Duplicate case label if you swap'em (Case Z of) Table error
Fr0sT.Brutal replied to Al T's topic in Algorithms, Data Structures and Class Design
You can wrap two 32-bit `case`-s in one `if` if num <= High(UInt32) then case num else case num shr 32 -
how to flush buffers on Indy components
Fr0sT.Brutal replied to al17nichols's topic in Network, Cloud and Web
If the connection doesn't break on transfer failure, you'll either have to analyze data stream for special "transfer broke" message or handle no-data-timeout. Alternatively you can wrap transfers into protocol messages so that client must be reading these messages always, then decide what's going on and what to do next - read data or request transfer again starting from some position. I'd go this way: CLI: <get filename from NNN> SRV: <data filename chunksize> [...chunksize bytes of data...] SRV: <data filename break> - failure indicator CLI: <get filename from MMM> -
Can Delphi 11 IDE handle debugging two Android phones at the same time?
Fr0sT.Brutal replied to Al T's topic in Delphi IDE and APIs
Havent't tried with Android but debugger has such option as "Attach to process". You don't need to run your app under debugger from the very beginning, you can attach to it right when a bug happens. -
The question is too broad currently. Answer depends on your operations. Linked lists are very good for adding/deleting but slower for search. Arrays are the opposite. Maybe you should consider hashmaps (dictionaries in Delphi). They simplify searching by key fields. In general, I'd try to avoid 3rd party components if native classes could satisfy your needs.
-
Sure you do! I was addressing Keesver.
-
Seems you misunderstood a bit, CONNECT is just a method of establishing connection via proxy. It also frequently referred to as HTTP tunnel. With this method proxy doesn't have to analyse HTTP headers, it just serves as pipe. Less actions => less bugs
-
Isn't there an option to just force CONNECT method for all destinations? HTTP proxy is lazy for clients but awful for servers
-
Playing an MP4 animation / unsupported media file / cppbuilder
Fr0sT.Brutal replied to alank2's topic in FMX
I guess only by inspecting asm code and registers. Search for Succeeded's body (Status and HRESULT($80000000) = 0;) and see the register/memory cell it AND's with -
Ask for comments to improve this code
Fr0sT.Brutal replied to Berocoder's topic in Algorithms, Data Structures and Class Design
You better derive TList<TObj> from classic TList, only overriding Get/Put methods so only those slim overrides would be compiled for each type used. type TTest = class fobj: TObject; end; TTest<T: class> = class(TTest) function get: T; end; function TTest<T>.get: T; begin Result := fobj as T; end; var test_tform: TTest<TForm>; -
Conditional compiling - Delphi has a bug
Fr0sT.Brutal replied to KodeZwerg's topic in RTL and Delphi Object Pascal
That IF shouldn't be evaluated at all as it lays inside falsy outer block {$IF Declared(FPC_VERSION)}- 5 replies
-
- delphi
- conditional
-
(and 1 more)
Tagged with:
-
Scrap TVirtualStringTree using Win 32 api (SendMessage)
Fr0sT.Brutal replied to MaxBayne's topic in Windows API
Try it 🙂 accessibility was implemented relatively recently but I believe TVM_GETITEM had been there much longer -
Delphi CE 10.4.2 - Command Line Compilation
Fr0sT.Brutal replied to PawelPepe's topic in Delphi IDE and APIs
So I was right finally. Emba needs to change their feature matrix table -
Scrap TVirtualStringTree using Win 32 api (SendMessage)
Fr0sT.Brutal replied to MaxBayne's topic in Windows API
VST doesn't have TreeView interface but it implements accessibility API (in VirtualTrees.Accessibility) and procedure TBaseVirtualTree.TVMGetItem(var Message: TMessage); message TVM_GETITEM; // Screen reader support function. The method returns information about a particular node. -
Delphi CE 10.4.2 - Command Line Compilation
Fr0sT.Brutal replied to PawelPepe's topic in Delphi IDE and APIs
Well, feature matrix says it should be available really but I vaguely remember some issues reported with cmdline on CE... -
Or Chinese ones...
-
Delphi CE 10.4.2 - Command Line Compilation
Fr0sT.Brutal replied to PawelPepe's topic in Delphi IDE and APIs
AFAIK CE doesn't allow cmd line compiling. One of limitations of free version -
Use the proper FireDAC's BLOBStream type instead of TADOBlobStream
-
Try this // Load JPG or PNG image from stream to picture. Format is auto detected. // Raise exception if something's wrong procedure LoadImageFromStream(Image: TImage; Stream: TStream); const JPGHeader: array[0..1] of Byte = ($FF, $D8); PNGHeader: array[0..3] of Byte = ($89, Byte('P'), Byte('N'), Byte('G')); var graphic: TGraphic; Header: array of Byte; begin graphic := nil; SetLength(Header, Max(Length(JPGHeader), Length(PNGHeader))); if Stream.Size > Length(Header) then try // Determine format by header Stream.Read(Pointer(Header)^, Length(Header)); if CompareMem(Header, @JPGHeader, Length(JPGHeader)) then graphic := TJPEGImage.Create else if CompareMem(Header, @PNGHeader, Length(PNGHeader)) then graphic := TPNGObject.Create else raise Exception.Create('Unsupported image format'); // Read the picture Stream.Position := 0; graphic.LoadFromStream(Stream); Image.Picture.Assign(graphic); finally FreeAndNil(graphic); end; end; ... if not Q.Query.FieldByName('Photo').IsNull then begin StmPhoto := TADOBlobStream.Create(Q.Query.FieldByName('Photo') as TBlobField, bmRead); try LoadImageFromStream(imgPhoto, StmPhoto); except on E: Exception do MessageDlg('Error loading photo:' + sLineBreak + E.Message, mtError, [mbOK], 0); end; StmPhoto.Free; end;
-
Modal dialog closes before user input
Fr0sT.Brutal replied to John Savoury's topic in RTL and Delphi Object Pascal
try ... DropDownDialog.ShowModal; If mItemIndex <> -1 then FItemSelected := mItemIndex-1; else FItemSelected := -1; Result := True; finally DropDownDialog.Free; end; Side note Also there's no sense in resetting ModalResult. And what is mItemIndex? Seems like global var. I'd advise to make it a dialog's property to reduce dependencies. -
The best way to handle undo and redo.
Fr0sT.Brutal replied to skyzoframe[hun]'s topic in Algorithms, Data Structures and Class Design
Best way WRT databases is generated SQL stored at client side or a change log stored in a table. But it could be tricky. Anyway the question is too broad to give concrete answers.