Recent

Author Topic: PopUpMenu error on Win7/10, Access violation or crash the application  (Read 1217 times)

patyit

  • New Member
  • *
  • Posts: 27
Hi all !
I have problem with PopUpMenu, when I Right Click on DBGrid the PopUp menu dos not apper, just crach the application or Access violation error message is shown.

On Lunux (Ubuntu 20.04 64bit) is OK, Win7 32/64bit Access violatin, Win10 32/64bit Application crash.

Lazarus 2.2.3 (rev lazarus_2_2_2-9-g64bc8e992e) FPC 3.2.3 x86_64-linux-gtk2
« Last Edit: May 31, 2022, 10:04:31 am by patyit »

rvk

  • Hero Member
  • *****
  • Posts: 6163
Lazarus 2.2.3 (rev lazarus_2_2_2-9-g64bc8e992e) FPC 3.2.3 x86_64-linux-gtk2
You have a crash on Windows but you're only showing the version info for Linux (which works fine).

Also, try just to create a empty project, drop a TDBGrid and TPopupmenu, populate the popupmenu in the IDE and set it in the TDBGrid.
Now run this and see if it still crashes on Windows.

patyit

  • New Member
  • *
  • Posts: 27
I'm showing the Linux version because I'm cross compiling it into Win32 / 64bit from here.

I created a new project with a DBGrid and PopUpMenu component and I am amazed to see that it works on Win32/64 without error (cross comiled on Linux) !
But then why not work on a live project ? It's a pretty big ERP type project, I've reviewed everything I can, everything looks good, but PopUpMenu doesn't work with any of the components, DBGrid, TreeView, Image, and so on. !
The project compiles without error, everything works correctly until the PopUpMenu is called (Right mouse click).

There was no problem with the previous FPC 3.2.0 / Lazarus version 2.0.12 !
Does anyone have any idea what could be wrong?  Maybe a unit is missing from the uses section ?

ps. On Linux, Ubuntu 20.04 64bit GTK2 64 bit is working perfectly !!!
« Last Edit: May 31, 2022, 02:55:25 pm by patyit »

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Try to provide the small compilable example, which shows the problem.

rvk

  • Hero Member
  • *****
  • Posts: 6163
I created a new project with a DBGrid and PopUpMenu component and I am amazed to see that it works on Win32/64 without error (cross comiled on Linux) !
...
Does anyone have any idea what could be wrong?  Maybe a unit is missing from the uses section ?
If the small project with minimal code works then there must be something else in your code which causes this.

Or you could try compiling it on Windows itself to see if it's a problem with the cross-compile.

(I never cross-compile, I prefer native development/compile just because of something like this)

patyit

  • New Member
  • *
  • Posts: 27
Ok, thanks rvk, I will install VBox with Win10 and will see.

patyit

  • New Member
  • *
  • Posts: 27
I installed Lazarus under Win10, compiled the program and the following error appears when I right-click on DBGrid (or other component linked with PopUpMenu)

rvk

  • Hero Member
  • *****
  • Posts: 6163
I installed Lazarus under Win10, compiled the program and the following error appears when I right-click on DBGrid (or other component linked with PopUpMenu)
And if it works with a minimalistic example then it must be something in the code.

We can't say anything more without looking at it.

 

TinyPortal © 2005-2018