[Lazarus] Using a component OBJ file in Lazarus?

Bo Berglund bo.berglund at gmail.com
Mon Jun 11 21:03:14 CEST 2018


On Mon, 11 Jun 2018 10:23:44 +0200, Michael Schnell via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>On 10.06.2018 15:11, Bo Berglund via Lazarus wrote:
>> ... Build IDE: Exit code 2, Errors: 23 ...
>
>You want to compile some 3rd party Dongle code in the IDE ?
>
>That is more than weired !
>

Sorry, I don't really know what you mean here...
What is the reason for this comment?
Unlike Delphi it seems like when one wants to add components to the
development IDE palette in Lazarus one has actually to *rebuild* the
IDE, there seems to be no otehr way...


We have analysis software (developed in Delphi) that we sell and it is
protected by the dongle.
Now I was looking at migrating our code to Lazarus/FPC and in that
process I had to also convert the custom components used in our code
to Lazarus. I managed to do so (with help from some people here) save
for 2 components, one is a TRichEdit derivative, which I think is not
really used, and the other is this dongle interface.

Now, for historical reasons, the dongle code was implemented as a
Delphi component contained in a component package in Delphi, so that
is why I am struggling to convert it.

However late last night I ran across an earlier attempt I had at this
about 3 years ago. In the leftover files on my disk I found a Lazarus
application that can actually interface with the dongle!

I also found a batch file that processed the SPROMEPS.OBJ file to
produce a COFF file (using objconv) for use in this test.

So I tried to copy this apparently working COFF file to my package
conversion project and edited the calling code to use this.
But when I tried installing the package I got the exact same errors
and Lazarus would not rebuild.

When I examined the main dongle file I noticed that I had earlier
modified it so it is not a component file anymore, just an ordinary
class definition file.

So now the plan is to take this modified class file and use it in the
migrated project without the component paradigm and see what
happens...


-- 
Bo Berglund
Developer in Sweden



More information about the Lazarus mailing list