[Lazarus] Newbie, porting class to FPC but get procedure assignment error

Bo Berglund bo.berglund at gmail.com
Mon Jun 22 01:00:58 CEST 2015


On Mon, 22 Jun 2015 00:02:40 +0300, patspiper <patspiper at gmail.com>
wrote:

>On 21/06/15 23:35, Bo Berglund wrote:
>> I added the -nr lines to my parameters file and re-ran the conversion.
>> Then moved the resulting coff file to the project dir and compiled:
>> Message pane shows:
>>
>> Compile Project, Target: DongleTest.exe: Success
>>
>> Seems like my dongle module is now compiled without errors! :)
>Great ;)
>> Next task is for me to add the calls to the methods of the object to
>> check if it will actually be able to read the dongle correctly.
>> Something for Monday.

>Pls report your findings. I am curious to see if it will actually work.

I just made a first test by adding the object to my main form as a
private variable. It is created in the form.create event.
I added a button and a static text control on the form and in the
button event I added the code to initialize the dongle and read its
serial number.
When I stepped through the code I reached the first call to the driver
via the obj file I get an exception when calling RNBOsproFormatPacket
in this function, which is in the SPROMEPS.pas file supplied by
SafeNet:

FUNCTION SproInitialize( ApiPacket : RB_SPRO_APIPACKET_PTR ) : WORD;
VAR
    returnVal : WORD;
BEGIN
    returnVal := RNBOsproFormatPacket (ApiPacket,
RB_SPRO_APIPACKET_SIZE);
    IF returnVal <> SP_SUCCESS THEN
       SproInitialize := returnVal
    ELSE
       SproInitialize := RNBOsproInitialize (ApiPacket);
END; { SproInitialize }

Exception text:

"Project DongleTest raised exception class
'External: SIGSEGV'."


>I wonder how spromeps.obj communicates with the dongle. Does it have a 
>driver, and if it does how does it communicate with it?

Yes, there is a driver involved and I have installed it in Winodws7
and it works just fine with my Delphi applications.
How the application communicates with the driver is unknown by me, it
is hidden inside the SPROMEPS.obj file....

>Does it work on Linux with Lazarus?

I have no idea but I doubt it. There is some support for Linux with
GNU C++ on Linux, but I have never used that...
In fact I have never programmed in Linux, except for PHP (web
functionality).

It seems like the very first time I call any function towards the
driver I get the exception SIGSEGV whatever that may mean...


-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list