-
Content Count
3006 -
Joined
-
Last visited
-
Days Won
135
Remy Lebeau last won the day on July 8
Remy Lebeau had the most liked content!
Community Reputation
1620 ExcellentTechnical Information
-
Delphi-Version
Delphi 12 Athens
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Did you try ParentBackground=True on the Panel? Then you would set only the Form's color and the Panel would pick up the same color.
-
Feel free to file a bug report.
-
TStyleManager.ActiveStyle will never return nil. If there is no style assigned then it returns the TStyleManager.SystemStyle (the Vcl.Themes.TUxThemeStyle class). TUxThemeStyle.Enabled returns True if the Win32 uxtheme.dll is successfully loaded and your app is manifested for ComCtrl32 v6. So, this is likely why your 'else' is never triggered. TUxThemeStyle.DoGetStyleColor(scWindow) returns clBtnFace, not clWindow as you are expecting. The style colors which return clWindow are: scComboBox scComboBoxDisabled scEdit scEditDisabled scGrid scListBox scListBoxDisabled scListView scTreeView TUxThemeStyle.DoGetStyleFontColor(sfWindowTextNormal) does return clWindowText, as expected. In any case, is your Label not simply set to Transparent=True or ParentColor=True?
-
"Seeming to work fine" is a possible result of Undefined Behavior. That doesn't mean the code was right, though. rundll32 requires a very specific signature for the entry point function that it calls, and your code was not satisfying that requirement. Fix that first, and if your UI problem still occurs then we can focus on that next. Sorry, I keep forgetting that Delphi doesn't define HINSTANCE as a type. Use System.HINST or Winapi.Windows.HINST or THandle instead.
-
Your Start() function is not compatible with rundll32. It's a wonder your code ever worked at all. You are invoking undefined behavior. Read: INFO: Windows Rundll and Rundll32 Interface Your Start() function MUST have the following signature in order for rundll32 to call it correctly: procedure Start(hwnd: HWND; hinst: HINSTANCE; lpszCmdLine: PAnsiChar; nCmdShow: Integer); stdcall;
-
Why not simply rename or move (not copy) the original temp file to the new filename, instead of copying its data to a new file? The only way I can see that happening is if you are not sending a response to the client until after the file data has been copied to the final file, and it's taking a long time to do that copy. Clients are not going to wait around forever for a response after they send their data to the server, so you should try to send a response as soon as possible, ie when the data has been saved in the temp file, or once processing of that file has begun in the background. If that is not an option, they you have no control over the client's timeout settings on the server side, so all you can do is optimize your processing to speed it up. If your processing is going to take a long time, then return a response ASAP and then provide a separate API for the client to poll the status of the processing, ie a separate REST endpoint, or a WebSocket, or server push events, etc. That has nothing to do with Indy, but with your OS and/or hard drive performance. Maybe you are writing to bad sectors, or there are other I/Os in progress that slow down the OS's handling of your file, etc. No way to diagnose that from your limited description. Also, TStream.CopyFrom() was pretty basic in 10.3. It was re-written sometime after 10.3 with more buffering logic. Speaking of buffering, consider using TBufferedFileStream instead of a plain TFileStream. TBufferedFileStream was introduced in Delphi 10.1. That way, more of the copying process is done in memory rather than directly on the hard drive. Handling data with file I/O will always be inherently slower than handling data in memory. It didn't. The client timed out and closed the connection on its end. If you are doing your file processing directly in your OnCommand handler then the server CAN'T close its end of the connection until you return control back to the server, ie by exiting the handler. Yes - don't perform long-running processes directly in your OnCommand handler that makes the client wait a long time for a response. No. Especially if different threads are working on different files. There is no timeout you can set on the server side that will affect the client's own timeouts. However, one thing you might try is TCP keepalives, not HTTP keepalives, ie via the AContext.Connection.Socket.Binding.SetKeepAliveValues() method. But, that won't prevent the client from just giving up if no response arrives in a long time.
-
Pascal code is compiled top-down in a single pass. DEFINE, IFDEF, etc are compiler directives that are evaluated only at compile-time. The resulting code is fixed, it cannot be changed at runtime. If you try to IFDEF something before it has been DEFINE'd, the result will be False. Hence the name IF-DEFined. In any case, DEFINE/IFDEF is not the correct solution for your problem anyway. You are making a decision based on data known only at runtime, so you need to add an extra parameter to your function that is called at runtime (you need to add a Sender parameter, too), eg: function doTheReport(Sender: TObject; Bo: Boolean); begin if Bo then Result := DoCharges(true, -1, False, False, False, lg('CLOSE CHARGES'), '1', dm2.SysDate.FieldByName('date').AsDateTime) else Result := DoCharges(Sender=nil, -1, False, False, False, lg(TDsFancyButton(Sender).Caption), '', 0, dm2.SysDate.FieldByName('date').AsDateTime); end; function selectReport(Sender: TObject); begin doTheReport(Sender, Sender = good1); end; Alternatively: function doTheReport(Sender: TObject); begin if Sender = good1 then Result := DoCharges(true, -1, False, False, False, lg('CLOSE CHARGES'), '1', dm2.SysDate.FieldByName('date').AsDateTime) else Result := DoCharges(Sender=nil, -1, False, False, False, lg(TDsFancyButton(Sender).Caption), '', 0, dm2.SysDate.FieldByName('date').AsDateTime); end; function selectReport(Sender: TObject); begin doTheReport(Sender); end;
-
That is why I suggested calling it AFTER the load had already failed the first time. But, I guess it doesn't matter, since it is unable to even load the DLLs into memory, so it will not be able to call the exported function that reports the version number. If you were using an up-to-date version of Indy, then on Windows WhichFailedToLoad() would include the error code for why SafeLoadLibrary() failed. It is clear from your screenshot that you are using an old version that does have include that error code. Offhand, that looks ok. But its hard to diagnose without knowing exactly where you got those DLLs from, and what external dependencies they actually have. If you right-click on the DLLs, what version numbers do their Properties show? And have you tried running the DLLs through any Dependency Viewer tools? You might also try using SysInternal Process Monitor to see what additional files Windows tries to access while the DLLs are being loaded. Yes, but I already mentioned the dependency issue in an earlier reply and you haven't addressed it yet. That is the most common reason for (Safe)LoadLibrary() to fail.
-
No.
-
Is Form 1 the Main form? Closing the Main form will terminate the app. You could just hide it instead, buy why do you want to close Form 1 at all? What exactly is stopping you from accomplishing what you want? What exactly have you attempted so far that is not working for you? Do you know how to create and open forms? Do you know how to add procedures to classes, and how to call them? Sounds like you are missing some fundamentals. Try something like this unit Unit1; interface ... type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); ... end; implementation uses Unit6; ... procedure TForm1.Button1Click(Sender: TObject); begin Form6 := TForm6.Create(Application); Form6.Show; Hide; Form6.DoSomething; end; end. unit Unit6; interface ... type TForm6 = class(TForm) procedure FormClose(Sender: TObject; var Action: TCloseAction); ... public procedure DoSomething; end; var Form6: TForm6; implementation ... procedure TForm6.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; Form6 := nil; end; procedure TForm6.DoSomething; begin ... end; end.
-
Targeting both Windows 10 and Windows 11 in appxManifest.xml
Remy Lebeau replied to apachx's topic in Delphi IDE and APIs
Did you try it and see if it does? -
Why TListView.OnItemChecked event called by ListView.Items.Add?
Remy Lebeau replied to Marsil's topic in VCL
RSS-3777: TListItems.AddItem() documentation is misleading -
C++Builder 12 Update 1: Migrating project, compiler versions
Remy Lebeau replied to BuilderFox's topic in General Help
Project > Options > Building > C++ Compiler > Use 'classic' Borland compiler -
Why TListView.OnItemChecked event called by ListView.Items.Add?
Remy Lebeau replied to Marsil's topic in VCL
The documentation is misleading. The properties are NOT duplicated at all. If you pass in an existing TListItem then it gets inserted as-is and becomes part of the TListView. -
What do the IdSSLOpenSSL.OpenSSLVersion() and IdSSLOpenSSLHeaders.WhichFailedToload() functions report after the load fails? So, the problem is in loading the DLLs themselves into memory, and not with obtaining pointers to the exported functions after the DLLs are loaded into memory? Perhaps the DLLs you were using have external dependencies (ie, VC++ runtime, etc) that were missing? Most of the DLLs on Indy's GitHub are built without external dependencies. Yes. The TLS 1.2 spec was released in 2008, and TLS 1.2 was implemented in OpenSSL 1.0.1 in 2012. What do you referring to?