Developing plug-ins in Free/Object Pascal: Delphi, Embarcadero, Lazarus, etc

A place where plug-in developers can share their knowledge and experience.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Developing plug-ins in Free/Object Pascal: Delphi, Embarcadero, Lazarus, etc

Post by citRiks »

Hello, thank you for sharing and caring, and you do it a lot :)
Good stuff, I am going to make use of it.
The sad part is, applying on editor selection is not working with any "external filter".
applying on the editor context seems to be ok.
i downloaded and installed Delphi (Embarcadero) for that purpose,
thinking probably i can fix it, considering your projects are in Delphi,
and by the incident i have had rather huge background in Delphi development (many years ago however).
Community edition, 10.3.3 (2019), licensed for 366 days trial, or something like that.
That is to say, legal, fresh installation.
And now i have even more sadness and questions, if you can help ?
The new Delphi is not working. At all.
It throws immediatly upon starting, either very soon after that, exceptions like:
"access violation at address 0x.. in module .... read of address 0x...
(different modules and memory addresses here)
Also when i create "hello world" app, or whatever basic.
On computer where works flawlessly several versions of Visual studio, VSCode, Eclipse, Java NetBeans, mingw/msys, and other regular stuff as well.
Here is legal fresh Delphi without any additional components.
i read about potential problems with delphi components, even TChart coming with Delphi installation,
so installed without any components beside Delphi x32 on the x32 host.
restarts, hour plus of googling and suggested registry tricking (HKCU\Software\Delphi\BDS). no love.

so, can you tip here me, and probably other folks,
how to make use of modern Delphi for FAR plugins build and debugging?

I got impression, Lazarus have compatibility with delphi projects?
am i wrong, or can it be the solution?

My host configuration:
Windows 7 Home edition x86, SP1
Delphi is from yesterday download, official community version (embarcadero)

Last edited by citRiks on Sun 18 Oct, 2020 17:09, edited 4 times in total.
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
pepak
Posts: 519
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 13 times
Been thanked: 42 times

Filters

Post by pepak »

citRiks wrote: Wed 14 Oct, 2020 11:17The sad part is, applying on editor selection is not working with any "external filter".
Seems to work fine for me as well. Note though that Filters is only applicable to regular blocks, not vertical blocks.
I took a look into the code, and it is not supposed to work by design too :)
there is something with 5 lines from the cursor, and not on selection.
Could you maybe be a bit more specific. I actually think that I designed the plugin precisely with the idea of supporting blocks.
The new Delphi is not working. At all.
It throws immediatly upon starting, either very soon after that, exceptions like:
Hard to say. Admittedly, I don't really do too much testing with Delphi 10.4 as my main development branches are Delphi 10 and Delphi XE2, but I find it unlikely that it would stop working so completely. Perhaps if the code was designed for pre-Unicode Delphi, then I could understand it, but not if I develop with Delphi 10 - the changes are not that big.

I would recommend compiling the plugin in DEBUG mode and using the Log function from the uLog method to mark its progress.
so, can you tip here me, and probably other folks,
how to make use of modern Delphi for FAR plugins build and debugging?
Building - use the build.bat scripts for that purpose. They have very few dependencies, basically just the compiler itself, everything else is set up to be self-sufficient.

Debugging - most of my plugins have their .dproj file set up so that if you copy the files to the appropriate places, the debugging will work "out of the box" - you simply "run" the plugin using F9 and FAR will start; you can place breakpoints within the plugin and they will react. The setup is:

- Copy FAR3 x86 to C:\fartest\far3
- Extract the plugin source code to C:\source\(plugin_name) (e.g. you would get C:\source\filters\bin\FiltersEng.lng); it may be a good idea to delete the old .dll files, although I don't think it's actually necessary.
I got impression, Lazarus have compatibility with delphi projects?
am i wrong, or can it be the solution?
Not sure. The GUI certainly isn't compatible, but I don't use that. I don't know how up-to-date is Lazarus (or FreePascal) with the modern Delphi features. Not that I use too many, but I do make use of both Unicode and generics, so these are required.
seems to be, I start to understand why and how Delphi went down to about zero popularity. Any other development enviroment run proper on the host, beside new Delphi. and all the internet is full of complaints to "access violation" without solution to it
I am pretty sure this is some problem related to your system specifically. Delphi do have their problems, sometimes serious problems, but what you describe is definitely not common.
pepak
Posts: 519
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 13 times
Been thanked: 42 times

Filters

Post by pepak »

Anyway, I just made a quick test with Delphi 10.4 compile and the plugin compiles without any issues and whatever I tried to do with it, it worked fine. Including the "external filter on a selection".
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Filters

Post by citRiks »

pepak, thank you for answering! i am going to provide you a lot of dull notes, keep on :)if you can
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Filters

Post by citRiks »

Oh, dear. I almost though i defeated the Embarcader new Delphi installation and use.
But, see the screen
image.png
There was is kind of progress, because i installed it not in default "C:\Program Files\..", but in the disk root, so that it can be without spaces in the path. And it behaves Ok some time, but continues to show this strange things, i dont know what is consequense and is it usable still
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Filters

Post by citRiks »

pepak wrote: Wed 14 Oct, 2020 18:27 The new Delphi is not working. At all.
It throws immediatly upon starting, either very soon after that, exceptions like:

Hard to say. Admittedly, I don't really do too much testing with Delphi 10.4 as my main development branches are Delphi 10 and Delphi XE2, but I find it unlikely that it would stop working so completely. Perhaps if the code was designed for pre-Unicode Delphi, then I could understand it, but not if I develop with Delphi 10 - the changes are not that big.
I would be happy to be wrong, i would also hard to believe, that this once kind of industry leader and industry standard, deteriorated so much, beyond any expectations.
Their current version is 10.3 of 2019, i took community edition RAD, and only choose Delphi x32 to isntall, with no extra-components (Them said on the stackoverflow there is often to be problems with any extra components choosen upon the installation)
So far my attempt to install and make use of it:
1.) Windows 7 HomePremium, x32, SP1. Restarts, reainstalls to places without spaces in the path, no luck
2.) Windows 7 Professional, x64, SP1. Th same as 1.)

Hacked version 10.4 from internet hacked downloads, unoficial preview beta.
Started to work partially at least, when installed to root of the disk, that is to say, so it can be without spaces in the installation path.
From here i put in the previous message the print screen with the error which still happen to be, probably there is more of it
Last edited by citRiks on Sat 17 Oct, 2020 15:51, edited 1 time in total.
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Filters

Post by citRiks »

[/quote]
citRiks wrote: Sat 17 Oct, 2020 15:46 Perhaps if the code was designed for pre-Unicode Delphi, then I could understand it, but not if I develop with Delphi 10 - the changes are not that big.
No, there is no any exotic code, i only tried to create some new "Hello world" proiject from the scratch, and immediatly from the scratch its tarted to crush about "memory access", i wrote the exact message in the previous this topic page.
Probably you can send the installation of your own?
Even without license key? I will do trial or whatever what will work with it.
It seems to me, previous versions is not appear on the oficial site.
Last edited by citRiks on Sat 17 Oct, 2020 16:01, edited 2 times in total.
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Filters

Post by citRiks »

A better view to "hello world" new project in the new Delphi, as it is in 2020 :)
image.png
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Filters

Post by citRiks »

pepak, propably you would sign in into the thematic far-dedicated telegram chanel here?
there is lot of useful communication, an probably it will be more convenient and appropriate to help with Delphi there,
because i am not sure moderation here will allow to us discuss Delphi on the phorum.
(although i think it yes appripriate, because we actually discuss far plugins building in Delphi)

https://t.me/FarManager
Last edited by citRiks on Sat 17 Oct, 2020 16:23, edited 1 time in total.
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
pepak
Posts: 519
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 13 times
Been thanked: 42 times

Filters

Post by pepak »

citRiks wrote: Sat 17 Oct, 2020 15:53Probably you can send the installation of your own?
I am sorry, but I can't legally do that.
citRiks wrote: Sat 17 Oct, 2020 16:23 pepak, propably you would sign in into the thematic far-dedicated telegram chanel here?
I don't use any IM and I don't want to start.
there is lot of useful communication, an probably it will be more convenient and appropriate to help with Delphi there,
because i am not sure moderation here will allow to us discuss Delphi on the phorum.
(although i think it yes appripriate, because we actually discuss far plugins building in Delphi)
Note that the problem is almost certainly related to your installation of Delphi, irrespective of any FAR issues. The error messages you posted strongly indicate that is the case. If I were to hazard a guess, I would say that the antivirus software you use either interferes incorrectly with some core Delphi library, or it deleted or modified that library during installation. I would definitely recommend that you create a new virtual machine with just Windows and nothing else, then install Delphi into it - I expect it will run just fine without any of the issues you describe.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Filters

Post by citRiks »

pepak,
pepak wrote: Sat 17 Oct, 2020 17:43almost certainly related to your installation of Delphi, irrespective of any FAR issues.
I think, it is related to FAR, because i tried to make something with your plugin :)
Furthermor, it happens to, i have two decent computers, without antivurus (i prefer to check stuff with VirusTotal)
On both computers it is exactly the same problem :(
I may triy it on some virtual machine, but it is kind of bad practice,
if i cant use it on my regular machines, it is kind of unreliable to work with it.
I will do the test with some new virtual, newly installed, but i hate the idea already .. will see..
or it deleted or modified that library during installation.
Can not be, it was clean installation, without anything tricky, on TWO computers where any other numeruos software and IDEs works flawlessly
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Developing plug-ins in Free/Object Pascal: Delphi, Embarcadero, Lazarus, etc

Post by citRiks »

pepak wrote: Wed 14 Oct, 2020 18:31 Anyway, I just made a quick test with Delphi 10.4 compile and the plugin compiles without any issues and whatever I tried to do with it, it worked fine. Including the "external filter on a selection".
I there community free version of 10.4 ?
From here currently you can download only 10.3.3:
https://www.embarcadero.com/products/de ... e-download
i t does not says the version immediatly, but when you start download it is 10.3.3
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Developing plug-ins in Free/Object Pascal: Delphi, Embarcadero, Lazarus, etc

Post by citRiks »

Looks like i can compile things there, with command line batches which you supplied.
but this is horrific experience not to have lets say, usual normal debugging abilities,
and with a bunch of exeptions on the way ..
Seems to be i am abandoning the idea of working with Delphi plugin development.
Although, any help is still appreciated.
Probably other people will be more successfull,
either newer Delphi versions will be more up to the mark.
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
pepak
Posts: 519
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 13 times
Been thanked: 42 times

Developing plug-ins in Free/Object Pascal: Delphi, Embarcadero, Lazarus, etc

Post by pepak »

citRiks wrote: Sun 18 Oct, 2020 01:08I there community free version of 10.4 ?
Not yet, and it's not certain there ever will be. Embarcadero is very proud of 10.4 and wants to milk it for what it is worth first.
either newer Delphi versions will be more up to the mark.
Again, this is most likely some issue with your particular system than a general Delphi thing. Delphi 10.3.3 that you are using is fairly well established, so if it fails horrifically for you, it probably means your system deviates from the expected in a major way. A new version of the compiler is unlikely to fix that.
citRiks
Posts: 899
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 274 times
Been thanked: 47 times

Developing plug-ins in Free/Object Pascal: Delphi, Embarcadero, Lazarus, etc

Post by citRiks »

pepak, this well established version fail miserably on my computers, where every other IDEs in the world run happily.
But nevermind, lets it be this way. :)
I would ask also, this. Lets i have community version installed, lets imagine it is usable.
But it shows me there is 366 days remainded, 365 days reminded, and so on, up to the end of the trial (?) period, i suppose.
But, why trial? isnt it supposed to be free community edition ?
the trial period can be prolongated without extra headaches?
Probably i can uninstall it and reinstall again to start again the trial period?
А кто не поверит в наше миролюбие, / Тот кровью умоется. / И будет такая борьба за мир, / Что камня на камне не останется.
Post Reply

Return to “Plug-In Developers”