Recent

Author Topic: Notepad++ plugin with dockingforms crashes; why? (Win 10 64 bit)  (Read 842 times)

d7_2_laz

  • Hero Member
  • *****
  • Posts: 589
Notepad++ plugin with dockingforms crashes; why? (Win 10 64 bit)
« on: December 09, 2024, 01:52:23 pm »
I'm trying to convert, on Windows 10 64bit, a very old (2013) Delphi 7 (32bit, Ansi) Notepad++ plugin to Lazarus 3.6 64 bit, unicode.
And did run into a couple of problems, e.g. a crash "On WM_CREATE", where i don't get a clue where and why (don't know yet how to debug this, so still copying the generated DLL to the belonging Notepad++'s config subfolder).
Notepad++ is from the recent versions (8.7.2 64 bit, portable version). See AccessViolation.jpg.

So i tried a fresh restart using a (hopefully) working example. Found one (meanwhile ancient though) within:
https://forum.lazarus.freepascal.org/index.php/topic,17888.15.html
--> See NPPPluginAndDemo.zip here, within reply #26, from eny.
Result:
Within the plugin demo options, i click "Docking window test", and see a crash, see jpg aattached.

==> Does anybody has any clue how to narrow this down?
Or point to an existing working example with docking forms?
Lazarus 3.6  FPC 3.2.2 Win10 64bit

AlexTP

  • Hero Member
  • *****
  • Posts: 2519
    • UVviewsoft
Re: Notepad++ plugin with dockingforms crashes; why? (Win 10 64 bit)
« Reply #1 on: December 09, 2024, 02:51:10 pm »
Open NP++ plugin in IDE. set 'host app' to NP++. then run the project. it must run NP++ and load your plugin (make sure it loads plugin from dev folder).
Then catch the crash in IDE.

This is what I did when debugging TotalCommander WLX plugin.

d7_2_laz

  • Hero Member
  • *****
  • Posts: 589
Re: Notepad++ plugin with dockingforms crashes; why? (Win 10 64 bit)
« Reply #2 on: December 09, 2024, 04:07:14 pm »
Great hint, thanks Alex!
That should help ... theoretically.  I see a more elaborated error box pointing out a hex address.
Looking in the debug's call stack, i see assembler code ("mov rdx, [rdp+$40]") which is not meaningful itself for me either, as there is no meaningful pre-history i could go back here.
And any breakpoint i set (ie. in the docking form's Create) arrives too late (not reached before the error box appears).

I'd guess that's due to the difference where Notepad++ expects the dll to be (beyond it's plugin subfolder, with a dll name matching the subfolder name), and the place where the DLL will be generated by Lazarus.

Hm. Is there a similar scenario with TotalCommander and WLX plugin?
« Last Edit: December 09, 2024, 08:45:21 pm by d7_2_laz »
Lazarus 3.6  FPC 3.2.2 Win10 64bit

d7_2_laz

  • Hero Member
  • *****
  • Posts: 589
Lazarus 3.6  FPC 3.2.2 Win10 64bit

 

TinyPortal © 2005-2018