Jump to content

plumothy

Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. plumothy

    Sender of TAction.OnHint Event?

    Anders, Thanks for clarifying. Yes you’re right, it’s a hack - but that is exactly what makes it interesting to me. (Although I think a single line of comments would be enough to explain it - “hack to get at sending Action in OnHint event”.) I really enjoy discovering how things work and what is “under the hood” (whether it’s how to build a Delphi application or how to build a house). I now have 3 possible answers to my original question and I will try them all (not just the hack) and then decide which to deploy in my project.
  2. plumothy

    Sender of TAction.OnHint Event?

    Anders, I don't understand. Please explain what you mean by that.
  3. plumothy

    Sender of TAction.OnHint Event?

    Remy - thank you. That looks interesting - I will try it.
  4. plumothy

    Sender of TAction.OnHint Event?

    Thanks Remy - I suspected as much. I wonder why they did it that way? Just about every other event I have ever used has a Sender parameter. I actually want to use OnHint for my Dataset Actions so I can customise the Hints depending on which dataset the Action is working on. Then the Hint can be more meaningful - eg "Delete order item" rather than a generic "Delete record". Your suggestion will work of course, but I might investigate creating my own descendant Dataset Action.
  5. plumothy

    Sender of TAction.OnHint Event?

    In the Object Inspector, if you double-click the OnHint event of a TAction then you get a procedure like this: procedure TForm1.Action1Hint(var HintStr: string; var CanShow: Boolean); There is no Sender parameter (like most other events have) so how can I tell which TAction made the call if several TActions share this event?
  6. Hi, I'm pleased to hear that I am not the only one! Thanks for the link to RSP-39519 - from there I saw someone else with similar issues was able to solve them by changing the project's resource compiler from Borland (BRCC32) to the Windows SDK one. So I did the same and it has fixed my particular issue but Embarcadero still need to investigate what is going on.
  7. Here is the code generated by Delphi in my TButton example: package MyOwnButton; {$R *.res} {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO OFF} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION OFF} {$OVERFLOWCHECKS ON} {$RANGECHECKS ON} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES ON} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DEFINE DEBUG} {$ENDIF IMPLICITBUILDING} {$IMPLICITBUILD ON} requires rtl, vcl; contains MyButton in 'MyButton.pas'; end. unit MyButton; interface uses System.SysUtils, System.Classes, Vcl.Controls, Vcl.StdCtrls; type TMyButton = class(TButton) private { Private declarations } protected { Protected declarations } public { Public declarations } published { Published declarations } end; procedure Register; implementation procedure Register; begin RegisterComponents('Samples', [TMyButton]); end; end.
  8. I have Delphi 11.2, Patch 1 running on Windows 11. This is my first post here so I hope someone can help. I want to create a new component that is a descendant of another component that is already installed. But I keep getting errors. As an example, here is what happens when I try to create a descendant of TButton... I did this: - Component | New Component - VCL for Delphi Win32 - select 'TButton' in list - Class Name = 'TMyButton' - Palette Page = 'Samples' - Unit Name = 'E:\MyButton.pas' - Selected 'Install to New Package' - Package Name = 'e:\MyOwnButton.dpk' - Click Finish. Got this error: --------------------------- Error --------------------------- Registration procedure, Mybutton.Register in package C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\MyOwnButton.bpl raised exception class EAccessViolation: Access violation at address 67127F63 in module 'rtl280.bpl'. Read of address 00000008. --------------------------- OK --------------------------- So, then I tried this: - Component | Install Packages - Add... - Browsed to select C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\MyOwnButton.bpl Got this error: --------------------------- MyOwnButton - Delphi 11 - MyButton [Built] --------------------------- Registration procedure, Mybutton.Register in package C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\MyOwnButton.bpl raised exception class EAccessViolation: Access violation at address 67127F63 in module 'rtl280.bpl'. Read of address 00000008. --------------------------- OK --------------------------- I am able to create TMyButton on Delphi 10.4 running on Windows 10 - so is there a bug in Delphi 11.2, am I doing something wrong or is there some other explanation?
×