![](https://en.delphipraxis.net/uploads/set_resources_2/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://en.delphipraxis.net/uploads/monthly_2019_01/P_member_735.png)
PeterBelow
Members-
Content Count
480 -
Joined
-
Last visited
-
Days Won
13
PeterBelow last won the day on April 30
PeterBelow had the most liked content!
Community Reputation
231 ExcellentTechnical Information
-
Delphi-Version
Delphi 11 Alexandria
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Add onClick event on TCanvas
PeterBelow replied to direktor05's topic in Algorithms, Data Structures and Class Design
You don't. Use a TPaintbox as a drawing surface, it has a Canvas and an OnClick event. TImage is another candidate, it contains (by default) a bitmap you can draw on using the image component's Canvas, and it also has an OnClick event. As explained in other replies a TCanvas is just a wrapper for a window's device context, it cannot receive mouse events directly. -
Access violation errors while running without the debugger
PeterBelow replied to christos papapostolou's topic in Algorithms, Data Structures and Class Design
Moving from D7 to Delphi 12 (Athens) is a very big jump. If you can build the old codebase at least you don't have to worry about old 3rd-party components, but there have been a lot of changes on the way, the most important one perhaps the move from ANSI to Unicode (UTF16) characters. Sizeof(char) = sizeof(byte) = 1 is no longer true, and that hits hard if the old code misused string variables for storing binary data. Incrementing a pointer of type PChar will now increment it by 2, not by 1, and that can easily cause old code to overwrite memory, which may be at the root of your problem. It may work for debugging just due to a different stack layout caused by different options, e.g. for using stack frames. A stack overwrite can corrupt a return address and that may lead to the exception you see. As recommended in other replies using a tool like MadExcept may be the best way to nail down the problem location, but if it is indeed a stack corruption the actual cause may be far from the location where it finally manifests. In this case doing an in-depth code review may be a better option, since there are likely more of these problematic code bits in your project. -
Do you know that you can supply up to four images in the bitmap you use for the Glyph property? See here for what they are used for. If your bitmap only contains one glyph image the control will synthesize the disabled image from it and the results are often not that good.
-
Troubleshooting W32ResourceDLL.Personality Error in Delphi Professional Athens
PeterBelow replied to Patricia Rosman's topic in General Help
The old translation tool has been deprecated for a couple of versions already and was removed from D12 completely. Check if it is still available as add-on via GetIt, the IDE seems to still use it. It was probably dropped finally since it's Windows only and i'm not sure if it ever worked for FMX projects even there. -
Troubleshooting W32ResourceDLL.Personality Error in Delphi Professional Athens
PeterBelow replied to Patricia Rosman's topic in General Help
May be a problem in the dproj file, the IDE has never been very good in converting that from a previous Delphi version. Make a backup of the project's dproj file, delete it, and then open the project's dpr file. That will create a new dproj file without any garbage from the previous version. You may have to adjust the project options, though. -
Setting Events on TPersistent members
PeterBelow replied to The Code Captain's topic in Delphi IDE and APIs
I think all you have to is to define the events with published scope and then register the property editor for that event handler type. -
How to import Type Library for Managed Code DLLs
PeterBelow replied to Ron Schuster's topic in General Help
The import menu should also have an "import .NET assembly" item that allows import of a COM-interop-enabled .NET library. -
delphi 12 migration Upgrade from delphi 6 to delphi12
PeterBelow replied to Sanu's topic in General Help
Emba Blog: https://blogs.embarcadero.com/upgrading-and-maintaining-delphi-legacy-projects/ https://blogs.embarcadero.com/a-roadmap-to-migrate-your-legacy-delphi-and-c-applications-to-the-latest-blazing-fast-version/ Book review: https://dalijap.blogspot.com/2022/06/book-review-delphi-legacy-projects.html I hope you have plenty of unit tests etc. for your project. With a jump that large and a project using many 3rd-party components this will probably amount to a major rewrite... -
Showing TMenuItem icons at design time in the IDE
PeterBelow replied to PeterPanettone's topic in Delphi IDE and APIs
Do you use the Bitmap property of the menu items or have you attached an imagelist to the popup menu and used the imageindex property of the menu items? The latter is the way to go these days. -
A bookmark with a name given by the user, not just a number as the standard IDE bookmarks get. The latter do not make sense across units but the former do.
-
The one on d: contains stuff fetched by the installer, the one on C:\users stuff you fetched via GetIt yourself, so both are independent.
-
How to debug a Not Responding program element
PeterBelow replied to Willicious's topic in Delphi IDE and APIs
If you can reproduce the problem in the debugger the Run -> Program Pause menu item should get you the code location the program is currently executing. -
What do you think of "Local Global variables"
PeterBelow replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Nested procedures/functions are basically legacy from the times of Turbo Pascal, before we could write properly object-oriented code. They are still useful for procedural code, but if you organize your program's tasks into classes then you can replace nested procedures with private methods of the class and either pass needed values as parameters or move the local variables used as private fields to the class declaration. IMO that gives a much cleaner and easier to understand design, and it keeps down the size of the methods. -
Refresh UI Desigh with DexExpress and / or TMS
PeterBelow replied to JIMSMITH's topic in Job Opportunities / Coder for Hire
This post may be better served in the Job Opportunities section off this forum. -
Safe Array Definition inside Type LIbrary Editor
PeterBelow replied to Robert Gilland's topic in RTL and Delphi Object Pascal
Is this for defining a method parameter? I think you have to define it as SAFEARRAY[VARIANT] (perhaps the syntax is SAFEARRAY(VARIANT), do not remember) in the code editor part, that is: in the ridl file. The type library editor only offers long as the element type for a safearray parameter. The server would have to construct a safearray with variants of type VT_RECORD. I have never worked with such user-defined types in COM applications, but from the docs it looks to be horribly convoluted, to say the least... As far as I know Delphi's support for OLE Variants does not include anything for UDTs, you would have to implement the necessary details in your own code.