Recent

Author Topic: [Solved] TPopupMenu OnDrawItem, compiler complains  (Read 1982 times)

d7_2_laz

  • Hero Member
  • *****
  • Posts: 625
[Solved] TPopupMenu OnDrawItem, compiler complains
« on: January 14, 2025, 12:09:55 am »
A Form within a DLL. For a TPopupMenu i let the IDE designer create an event handler for "OnDrawItem".
Compiler complains:

MyDockingforms.pas(477,33)   Error: function header doesn't match any method of this class  "PopupMenu1DrawItem(TObject;TCanvas;TRect;TOwnerDrawState);"
MyDockingforms.pas(67,15)   Error: Found declaration: PopupMenu1DrawItem(TObject;TCanvas;TRect;TOwnerDrawState);

Tried in a new project / application ..... there's no problem.
What might cause this?  (I suspected the order of units in the uses clause, but it appears for me it's not dependent on this)

I'd be pretty sure that somebody encountered something similar elsewhere ...
« Last Edit: January 14, 2025, 12:38:19 am by d7_2_laz »
Lazarus 3.8  FPC 3.2.2 Win10 64bit

d7_2_laz

  • Hero Member
  • *****
  • Posts: 625
Re: TPopupMenu OnDrawItem (in a DLL:) - compiler complains, why?
« Reply #1 on: January 14, 2025, 12:37:26 am »
Oh no ... "Windows" was in the "implementation" uses (i overlooked it there).
I moved it to the "interface" uses before "Menus", problem gone.
Lazarus 3.8  FPC 3.2.2 Win10 64bit

 

TinyPortal © 2005-2018