-
Content Count
2975 -
Joined
-
Last visited
-
Days Won
106
Everything posted by dummzeuch
-
Hack to access an ancestor's private method
dummzeuch posted a topic in RTL and Delphi Object Pascal
Given the following class: unit Ancestors; interface type TAncestorClass = class private procedure SomeMethod; end; [... stuff ...] ... and a descendant class that is declared in a different unit: unit Descendants; interface uses Ancestors; type TDescendant = class(TAncestor) protected procedure SomeOtherMethod; end; // [...] implementation procedure TDescendant.SomeOtherMethod; begin SomeMethod; // <-- this won't compile end; I need to call the private TAncestor.SomeMethod from TDescendant.SomeOtherMethod. This of course won't compile because TAncestor.SomeMethod is declared as private and I cannot change that declaration (It's part of the Delphi VCL). My solution so far is to copy the implementation to my unit, but I am pretty sure this would violate Embarcadero's copyright on that (non trivial) code if I were to release that source code. So I am looking for a different solution. It guess it would be possible to somehow patch my class to call the original code, but I have never done something like that. Is there any documentation / blog post / example code on how to do that? I am aware that I would then possibly have to adapt this patch to every Delphi version. Any hints? Edit: Note: Class Helpers and extended RTTI are not an option here. This must work with Delphi 2007. -
Hack to access an ancestor's private method
dummzeuch replied to dummzeuch's topic in RTL and Delphi Object Pascal
No, I can't. -
Hack to access an ancestor's private method
dummzeuch replied to dummzeuch's topic in RTL and Delphi Object Pascal
That works only for private fields, not for private methods. -
Hack to access an ancestor's private method
dummzeuch replied to dummzeuch's topic in RTL and Delphi Object Pascal
I'll check it out, thanks. -
Hack to access an ancestor's private method
dummzeuch replied to dummzeuch's topic in RTL and Delphi Object Pascal
Unfortunately that only works in class helpers. -
project.exe is open in another program errors
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
So, are you seeing the error I described in the blog post? -
I need an English translation for the German Word "Laufleistung" (Kilometerleistung), which gives e.g. the distance a car or a tyre has travelled in its lifetime. Every translation service suggests "mileage", but showing "mileage [km]" (mileage in kilometres) looks wrong to me. DeepL also suggests "kilometrage", which I had never heard before. Is that really used? Probably not in the US and UK. What about other English speaking countries with a more sane unit system? (Are there any? 😉 ) I would prefer a word that is unit agnostic (Like the German "Laufleistung" which does not include the unit itself). DeepL also suggested "running performance" but that's even wider than the German word and I have also never heard it before.
-
Wow, I totally missed that. (This still doesn't increase the likelyhood of that particular software ever being used in the US.) Now, if they switched to a sane date and time format, that would be cool. Or did that happen and I missed it too?
-
project.exe is open in another program errors
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
In my case it's not Windows 10 but Windows 8.1. -
Thanks, but the US is not a market for this program (and probably will never be, but who knows? It's probably as likely as the US converting to metric. 😉 )
-
I will probably go with "mileage" then, even though that will raise questions whenever some translator stumbles upon it (the next translation will be to Portugese, that's going to be interesting).
-
No. An Odometer is a device to measure mileage. "Odometer value" or something like that would probably be OK for some usages but not in my particular case (which is the "mileage" of a special type of tyre).
-
Looking for beta testers of TFrameStand and TFormStand
dummzeuch replied to Andrea Magni's topic in FMX
Btw: Your github page says: ##Get started Have a look at my blog posts about TFrameStand Unfortunately that link seems to be broken. http://www.andreamagni.eu/wp/tag/tframestand/ It should probably be https://blog.andreamagni.eu/tag/tframestand/ instead. -
Blocking the Windows Screen Saver in Delphi
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I used a similar hack in an earlier version of my program: Wiggling the mouse pointer. While that worked fine under Windows XP, it doesn't under Windows 10 (no idea about Windows 7 and 8). That was the reason I researched how to do it "right". Toggling numlock all the time would drive me crazy. -
New GExperts IDE enhancement: Export and Import entries for the Tools menu
dummzeuch posted a topic in GExperts
The Delphi IDE has the quite useful option to add custom entries to the Tools menu. These entries call external programs with some “Macros” that reference the current IDE status, e.g. the currently active project or source file and some of their properties like the output directory or the current editor column and row. GExperts already enhances the Tools Properties dialog by adding auto completion for the file name and the working directory (for Delphi 6 and 7 it also adds support for Drag and Drop, but that doesn’t work for later versions). It has always irked me that there was no easy way to port these custom tools entries from one Delphi version or installation to another. I always had to copy and paste four fields to achieve that. GExperts now adds two new buttons to export and import the current entry: Read on in my blog post https://blog.dummzeuch.de/2019/06/08/new-gexperts-ide-enhancement-export-and-import-entries-for-the-tools-menu/ -
New GExperts IDE enhancement: Export and Import entries for the Tools menu
dummzeuch replied to dummzeuch's topic in GExperts
Only one at a time. There is no API for them and I can't get at the data from the dialog that lists them. It's also not possible to directly modify the registry while Delphi is running, it will simply overwrite the new entries. Also there appear to be two different formats for the registry entries and they reference resource strings in the IDE. It's a veritable mess. -
Passing back a string from an external program
dummzeuch replied to dummzeuch's topic in Windows API
If there are multiple instances of program1 and it always uses the same file name when it starts its own instance of program2. These multiple instances would then all write to the same file. That's a race condition in my opinion. -
Passing back a string from an external program
dummzeuch replied to dummzeuch's topic in Windows API
I would like to remind you that I was asking for experience with the IPC methods: For now I have implemented it with passing a file name as described in my original post. Does this have any drawbacks (apart from the obvisous one: It creates a race condition. I have mitigated this for now by creating a unique temporary directory to place the file in. -
Passing back a string from an external program
dummzeuch replied to dummzeuch's topic in Windows API
From the description it looks to me that atoms are immutable. So how do you propose to return a string from program2 to program1 via a global atom? -
If you insist on Github, you can simply create the project there and upload the sources using subversion. Alternatively you could create a project on Sourceforge or OSDN.
-
In my last blog post Getting the Windows version, I claimed that there is no way to get the actual version number of Windows 10 without reading the version information of the Kernel32.dll and interpreting it 1. Since then I have been told that there is actually a Registry key that contains the Windows version: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion It has several entries that can be used to get the same version info that the Winver tool displays to the user. On Windows 10 that’s: ProductName ReleaseId CurrentBuildNumber UBR On my test installation they get me “Windows 10 Pro” Version “1809” (OS Build “17762”.”437″) (The quotes denote values read from the registry.) https://blog.dummzeuch.de/2019/04/22/getting-the-windows-version-revisited/ Just to make it clear: The above text is not the full blog post.
-
In my last post I wrote about the export and import feature for custom Tools menu entries that GExperts adds to the Delphi IDE. I also mentioned that I was thinking about adding a custom clipboard format for copying and pasting these entries between multiple Delphi instances / versions. OK, I did that. GExperts now also adds a popup menu to the Tool Properties dialog with two entries: Copy entry to clipboard Paste entry from clipboard Read on in the blog post https://blog.dummzeuch.de/2019/06/09/gexperts-adds-copy-and-paste-for-delphi-tool-menu-entries/
-
New GExperts IDE enhancement: Export and Import entries for the Tools menu
dummzeuch replied to dummzeuch's topic in GExperts
Yes, I could. -
Getting the Windows version revisited
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I'm aware of TOSVersion, but it's simply not available in some of the Delphi versions I frequently use. As stated in the blog post, the method(s) described there even work(s) with Delphi 6. -
Increasing registration count not possible without active maintenance support
dummzeuch replied to Leif Uneus's topic in Delphi IDE and APIs
In my case it's because I need access to specialized devices (cameras, lasers, GPSes ... some of it only available in one of our measuring vehicles) to develop and debug software that communicates with these devices. Most of that communication is time critical, so even if that device access could be virtualized, it would only get me so far (I can use remote desktop though, so I don't have to sit in the actual car.) I tried to use the remote debugger, but it was not stable enough. So I ended up installing Delphi on each of the controlling computers. Of course I ran into the installation limit frequently, because those computers just don't survive the conditions they are used in for much longer than 2 years (it's cheaper to frequently replace them rather than trying to protect them.) That's why I switched to a network named license last year. Much more convenient. Of course that's not quite the typical use case for Delphi. Until Microsoft stops supporting your operating system and the corporate IT department tells you to upgrade, because your Windows XP/7/8 is a security risk. And even if that does not happen, keeping several VMs up to date while maintaining backups quickly becomes a major chore. Even with multi terabyte hard disks it still takes time to copy them around.