

Brian Evans
Members-
Content Count
392 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Brian Evans
-
Making a Windows API call for every cell to get the text height will be slow period. The call is required since the text needs to be re-flowed when the width changes. It does all cells to get a new total height. As I mentioned for speed you need a different approach that doesn't need to calculate total height.
-
A scroll bar that is based on # of rows instead of height and only using enough labels to fill the visible area - swapping/drawing content, as necessary. The drawback is jumpy scrolling instead of smooth due to row at a time vs line at a time, but it is orders of magnitude faster. A lot more work to do it with a ControlList but most grids that support variable row height will do all it for you.
-
Delphi app using Access database very slow on network drive.
Brian Evans replied to Jean-Michel Gaudette's topic in Databases
Huge slowdowns on a file server can often be due to failed write cache battery backup on a raid controller with spinning disks attached. With two different customers seeing the issue this is less likely the cause. A local SSD or even HD can hide issues with queries and indexes - scanning a 1GB table is nothing from a local SSD but will be much slower going over the network to a spinning disk. Same if antivirus scans the MDB on first open - much faster locally vs across the network. Can check Resource Monitor and see how much disk reads are required when the application does a query. -
How can you track that the mouse is over a certain control or over any of its Child controls.
Brian Evans replied to dmitrybv's topic in FMX
Another approach: Code like that suggested by Dave but in the form's MouseMove and leave MouseLeave for the panel blank. procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); var LPoint: TPointF; begin if (ParentPanel.Fill.Color = TAlphaColorRec.Red) then begin LPoint.X := X; LPoint.Y := Y; if not ParentPanel.AbsoluteRect.Contains(LPoint) then ParentPanel.Fill.Color := $FFE0E0E0; end; end; procedure TForm1.ParentPanelMouseEnter(Sender: TObject); begin ParentPanel.Fill.Color := TAlphaColorRec.Red; end; procedure TForm1.ParentPanelMouseLeave(Sender: TObject); begin // ParentPanel.Fill.Color := $FFE0E0E0; end; -
Unicode NBSP(u00A0) No-Break Space character for 64-bit
Brian Evans replied to sp0987's topic in RTL and Delphi Object Pascal
In 64bit RAX does not contain the first parameter of your Int2Hex function, RCX does. Looks like there are also other problems with the 64 bit ASM code like where the return value is stored: it should end up in RAX, Ref: Using Inline Assembly Code - RAD Studio (embarcadero.com) Ref: Assembly Procedures and Functions - RAD Studio (embarcadero.com) -
I read the question too fast, the code that should have GetLastError added to see any errors specific to the rename (like file open) is commented out. Delphi equivalent pattern is: if RenameFile(oldName, newName) then ShowMessage('File renamed OK') else ShowMessage('File rename failed with error : '+ IntToStr(GetLastError));
- 10 replies
-
- c++ builder
- 11.3
-
(and 1 more)
Tagged with:
-
Normal practice to use GetLastError to see what the problem is when some Windows APIs fail. GetLastError function (errhandlingapi.h) - Win32 apps | Microsoft Learn
- 10 replies
-
- c++ builder
- 11.3
-
(and 1 more)
Tagged with:
-
Can you set it up and test it in the ODBC Data Source Administrator (32-bit)? It should tell you if the 32-bit drivers required are available/installed. If only the 64-bit drivers are installed the newer versions of this utility will mention it. For example on my system I do not have the 32-bit drivers:
- 10 replies
-
Couldn't tell you. The wording does suggest they do. The InterBase licensing was too much for me, both cost wise and having to manage licenses, that back in the day I looked for a royalty free alternative. Went with FlashFiler from TurboPower and when they exited the market transitioned to using NexusDB. Combined with a tool to help write queries (Database Workbench by Upscene) it has served my needs for almost two decades.
-
F2047 Circular unit reference.
Brian Evans replied to dmitrybv's topic in RTL and Delphi Object Pascal
I move my own units from the uses clause in the interface section to the implemenation section. An example would be two forms that access some of each other's properties and objects. They have each other listed in the implementation's uses clause. -
InterBase Developer Edition is free and included with Delphi as an optional feature you can choose in the installer. You can also request a license. The main limitations are: Limited to a maximum of 20 users (and 80 logical connections to the server) Limited to work only for 48 hours, after that time new connections are disallowed and you'll have to restart the server Download the Free InterBase Developer Edition - Embarcadero
-
Showing TMenuItem icons at design time in the IDE
Brian Evans replied to PeterPanettone's topic in Delphi IDE and APIs
It seems beyond your ability to not be obnoxious. I don't see a point in continuing to converse who you. -
Showing TMenuItem icons at design time in the IDE
Brian Evans replied to PeterPanettone's topic in Delphi IDE and APIs
I don't think it is "displaying a TPopupMenu at design time" but is a custom form used to design menus. Works fine for the biggest requirements: add menu items and show their relation to each other. -
Delphi 12.1 Amnesty price isn’t what I thought it was…
Brian Evans replied to Al T's topic in Delphi IDE and APIs
Notice in buy now it shows $3,000 Perpetual License + $999 for one year of Maintenance for Delphi Enterprise. If support is still $999/year that is not much of an anmesty at $2599. Looks like they offered that price or close to it last fall but included 24 months of support. They sometimes offer(ed) discounts on longer support renewals - like 20% off 60 months (paid $ ~4,000 USD in 2022 for that myself on an active Delphi Enterprise license). Might be worthwhile waiting them out or occasionally asking sales about any offers etc. -
RAD Studio 12 Update 1 IDE Instability
Brian Evans replied to Navid Madani's topic in Delphi IDE and APIs
For code navigation I use MMX Code Explorer which was taken over by Uwe Raabe and is available for free. I have a large wide screen monitor so docking the MMX navigation panes works well. A New Home for ModelMaker Code Explorer™ – MMX (mmx-delphi.de) MMX – speed up your Delphi development (mmx-delphi.de) -
RAD Studio 12 Update 1 IDE Instability
Brian Evans replied to Navid Madani's topic in Delphi IDE and APIs
Early on I read the terms for the Parnassus stuff, and it included text about sending system information back to them. I have avoided them since because the code to do that often hangs the IDE or causes issues when a security system/IDS/IDP blocks such collection and communication. From the Data section of : License Agreement - Parnassus OÜ -
Delphi Clipboard - WM_CLIPBOARDUPDATE (sent, but no changes)
Brian Evans replied to PawelPepe's topic in VCL
Windows messes with the clipboard so higher integriity processes do not see/get content put there by lower integrity processes. This may be the source of the extra change messages. The problem tasks you list all run with a High integrity level while most things like File Explorer run with Medium. Might have to keep track of the clipboard content and check it is has really changed (not just went from empty to having something or the reverse). -
What are the performance profilers for Delphi 12?
Brian Evans replied to dmitrybv's topic in General Help
There is Nexus Quality Suite | NexusDB which "works with Delphi 5 to Rad Studio 12 Yukon and beyond!". It has a long lineage as it is a successor to the long defunct TurboPower Sleuth QA Suite. A book is available on high performance Delphi which has a free chapter on profiling: Delphi High Performance - Second Edition | Packt (packtpub.com) that covers various tools. -
Why does IDE require UAC elevation when starting?
Brian Evans replied to Tom F's topic in General Help
Note Windows does not allow drag and drop from a lower privileged process to a higher privileged one. It is part of UIPI (User Interface Privilege Isolation). If you run Delphi elevated the default file explorer which runs as a regular user will have issues with dropping to Delphi. -
FireDac in memory dataset filter before iterate?
Brian Evans replied to Mark Williams's topic in Databases
Usually start with the bottom question/answer from: TFDMemTable Questions - RAD Studio (embarcadero.com) especially the use of BeginBatch / EndBatch. -
Google Drawings does a decent job.
-
This might not apply but: most databases have temporary tables of various lifetimes. SQLite has temporary tables that are database session specific and go away on their own when the session is closed.
-
Darn seems SQL Server doesn't allow the password to be parameterized. An odd quirk. Two options I can think of : passing parameterized values into a chunk of SQL that then creates dynamic SQL and runs that (ex: answer to c# - How to change a sql login password with variables - Stack Overflow) or turning preprocessing off in FireDAC ( qry.ResourceOptions.PreprocessCmdText := false; ) for the query.
-
How I can know the procedure that was executed before another procedure ?
Brian Evans replied to William23668's topic in Delphi IDE and APIs
The Call Stack window should be showing it during program execution when it hits the breakpoint. -
You could pass the password as a parameter to avoid any FireDAC string/macro processing. Use one of the ExecSQL overloads to get rid of the housekeeping lines. qry.ExecSQL('ALTER LOGIN sa WITH PASSWORD = :PASSWORD',['newPASSWD'],[ftString]);