Talk:Third-Party Help Menu Item (Delphi)
In the page, you wrote:
MyHelpMenuItem.Caption := 16; MyHelpMenuItem.ImageIndex := 'My Company';
Instead, it must be:
MyHelpMenuItem.Caption := 'My Company'; MyHelpMenuItem.ImageIndex := 16;
the provided code does not compile
the provided code does not compile, because this assignment -> MyOnlineHelpMenuItem.OnClick := OnlineHelpClick; is not allowed.
1. declare a TMethodContainer = class(TObject), like:
TMethodContainer = class(TObject) procedure OnlineHelpClick(Sender: TObject); end;
2. create an instance of it in procedure Initialize(Sender: TObject);, like:
aMethodContainer := TMethodContainer.Create;
3. assign MyOnlineHelpMenuItem.OnClick with:
MyOnlineHelpMenuItem.OnClick := aMethodContainer.OnlineHelpClick;
I can send the complete refactored unit if required
Hi Didier Cabale,
Thank you very much for pointing out this error in our documentation. I have updated the code on this page per your comment: Third-Party Help Menu Item (Delphi).
Would you be so kind and verify that I have added the best solution? I have tried it and it works, but I am not a professional programmer so your solution may be better.
You can provide feedback about a specific wiki page also by using the link "Help Feedback" on the bottom of a page or writing directly to email@example.com.
I precised the requirements of my first post, directly in the message. (It is needed to create the TMethodContainer). You would be kind to modify.
This modified code should work, but I'll send you later a cleaner code. Best regards.