Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-06

I have some custom components, can I convert Delphi -> Lazarus?

41 messages · 11 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I am investigating if I will have any chance to switch to Lazarus/FPC from Delphi with our code projects. I have now read a good many wiki and other pages and it seems like I will have problems getting started because of the following component related issues:

1) We have created a number of non-visual components that are dropped on the forms to supply various kinds of functionality. Some of these are handlers for language dependent texts, software protection dongles, communications interfaces like RS232 serial components, logging functions etc.
Seems like non-visual components are not handled by Lazarus according to wiki texts I have read.

2) We also created children of a few VCL components to enhance their use, like the TListView which Delphi defaults to states we never use. So we made a TEasyListView child where we add some properties and set the defaults of others differently. THis is used in a large number of forms...

3) We created a custom component package, which we always install into any new Delphi installation before we go to load the projects. It seems like component packages do not exist in Lazarus...

4) We use several open source component packages as well:
- Indy 10
- Asynch Pro
- GLScene (an older version 0.8.x is needed)
How can we handle this? Especially the GLScene one would be a killer if not possible to use in Lazarus at level 0.8.x. When GLScene went from 0.8 to 1.0 they removed a very important property of the viewer, which I never could repair. So I had to stick with 0.8.2.

5) We use some VCL features which according to wiki pages I have read are not supported in Lazarus, like TSplitter (used in many forms). (http://wiki.freepascal.org/Lazarus_For_Delphi_Users)

6) An important non-visual component on almost all of our applications is a handler I wrote a long time ago (about 2000) for the Safenet Sentinel Superpro software protection dongle. It is mostly my own code but it uses pas and an obj file supplied from Safenet. If Lazarus does not work with this obj file then I would be dead in the water... How can I find out?

Bo Berglund Developer in Sweden

Reply by email

leledumbo
to Bo Berglund
Seems like non-visual components are not handled by Lazarus according to

wiki texts I have read.

Then how we can use T[mention a dbms here]? Dialogs? Action list? Logger? Indy? etc. All of them are non-visual.

How can we handle this?

Indy 10 -> already supported
TurboPower Async Pro -> feel free to port
GLScene -> they're moving forward, so are we. If you need to stick with old version that no longer works, I'm afraid you're alone to make the package work with current Lazarus version.

We use some VCL features which according to wiki pages I have read are not supported in Lazarus, like TSplitter

It was, but for a long time both TSplitter and TPairSplitter have been existed until now. Both seem to work fine although I prefer TPairSplitter (I've ported a Delphi project which uses TSplitter).

How can I find out?

Free Pascal deals with COFF object files. If those object files from your vendor are not in this format, then you can't use it. Ensure what the object files format is first, then consult back here. You can try linking the object files, if the linker refuses, then you know the conclusion.

Reply by email

Graeme Geldenhuys
to Bo Berglund: I am investigating if I will have any chance to switch to Lazarus/FPC from Delphi with…
Bo Berglund wrote
I have now read a good many wiki and other pages and it seems like I will have problems getting started because of the following component related issues:

It seems a lot of that wiki text is out of date too. ;-) So it is good you rather ask here or in the Lazarus Forums.

Sentinel Superpro software protection dongle. It is mostly my own code but it uses pas and an obj file supplied from Safenet. If Lazarus does not work with this obj file then I would be dead in the water...

Leledumbo already answered that.

If you could consider alternatives, then you could take a look at the FPC port of Turbo Power's OnGuard. I've been using this for years in a commercial environment creating trial versions, leased software etc. My port is available on Github [https://github.com/graemeg/onguard], but I believe another port is floating around somewhere too.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Schnell
to Bo Berglund: I am investigating if I will have any chance to switch to Lazarus/FPC from Delphi with…
Bo Berglund wrote
If Lazarus does not work with this obj file then I would be dead in the water...

Lazarus (including packages) and free pascal are cross-platform tools supporting multiple Archs and CPUs. So an "obj" file can't be "decently supported" as it will work just on a single CPU/OS combination.

If you just want Windows/X86, why not stay with Delphi ?

-Michael

Reply by email

aradeonas
to Michael Schnell
If you just want Windows/X86, why not stay with Delphi ?

I dont know his reason but multi platform is not ?the only reason for Lazarus,Mostly I develop for Windows but my main reason for developing with Lazarus is simple as I love it ;)

Regards, Ara

http://www.fastmail.com - Or how I learned to stop worrying and love email again -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150616/ebb90303/attachment.html>

Reply by email

Sven Barth
to Michael Schnell: Lazarus (including packages) and free pascal are cross-platform tools supporting multiple…
"Michael Schnell" wrote
On 06/15/2015 08:21 AM, Bo Berglund wrote: > > If Lazarus does not work with this obj file then I would be dead in

the water...

Lazarus (including packages) and free pascal are cross-platform tools

supporting multiple Archs and CPUs. So an "obj" file can't be "decently supported" as it will work just on a single CPU/OS combination.

Please don't assume that only because one /can/ write cross platform code with FPC/Lazarus that one must do so. ;)

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150616/ee425ee1/attachment.html>

Reply by email

Graeme Geldenhuys
to aradeonas: I dont know his reason but multi platform is not ?the only reason for Lazarus,Mostly I…
aradeonas wrote
but my main reason for developing with Lazarus is simple as I love it ;)

+1

Being open source and allowing me to customise things the way I like is a brilliant feature. I also think FPC is a way better compiler than Delphi - on many levels.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Bo Berglund
to Graeme Geldenhuys: It seems a lot of that wiki text is out of date too. ;-) So it is good you rather ask…
Graeme Geldenhuys wrote
It seems a lot of that wiki text is out of date too. ;-) So it is good you rather ask here or in the Lazarus Forums.

Well I tried reading the docs first because on other fora you are told to RTFM first. Hard when the manual text is inaccurate. I will use this avenue then.

Show quoted text 5 lines
> Sentinel Superpro software protection dongle. It is mostly my own code > but it uses pas and an obj file supplied from Safenet. If Lazarus does > not work with this obj file then I would be dead in the water... Leledumbo already answered that.

It might be the killer for me then...

Show quoted text 6 lines
If you could consider alternatives, then you could take a look at the FPC port of Turbo Power's OnGuard. I've been using this for years in a commercial environment creating trial versions, leased software etc. My port is available on Github [https://github.com/graemeg/onguard], but I believe another port is floating around somewhere too.

Not really possible because we have thousands of customers using the software which I am now considering porting to Lazarus. So I definitely need to keep going with the SuperPro system. I think I will ask the support at SafeNet for their views.

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Michael Schnell: Lazarus (including packages) and free pascal are cross-platform tools supporting multiple…
Michael Schnell wrote 6 lines
On 06/15/2015 08:21 AM, Bo Berglund wrote: > If Lazarus does not work with this obj file then I would be dead in the water... Lazarus (including packages) and free pascal are cross-platform tools supporting multiple Archs and CPUs. So an "obj" file can't be "decently supported" as it will work just on a single CPU/OS combination.

OK, then I understand. Might not be easy to get that out of Safenet..

If you just want Windows/X86, why not stay with Delphi ?

Have you looked at the deterioration of the Embarcadero support lately? Just try their user forum or the news mirror of it! It is offline at least half the time every day at random times. Week-ends if crashing it stays off-line until Tuesday (in Europe).

And the problems started more than a year ago; when they finally came on line again they had lost all past threads and basically started out totally blank!
This is a problem for more than a year now!
Meanwhile they have started the money game:

- Every 6 months they release a new version of their RAD Studio XE, bought in on XE5 as an upgrade from RAD Studio 2007 at the end of 2013 to test multi-platform support, then I skipped XE6 but felt that I had to get up to date so I bought XE7 not even 2 months later they came out with XE8...
And the upgrades are really expensive too!

- The problem I feel is that as soon as they release a new version all support stops for the earlier versions. There are no longer any patches or updates coming along and all bug reports must be against the latest version.

- The next problem is that they do not feel obliged to fix the bugs reported until maybe in a much later release. There are numerous threads in their forum about this where angry customers show how a serious bug has propagated for years even in face of a Quality Central report every time...

So even though I have used Delphi since 1995 (D1-D2-D3-D4-D5-D7-(long time use)-BDS2006-D2007-XE5-XE7 I am now feeling weary of it all...

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Sven Barth: the water... supporting multiple Archs and CPUs. So an "obj" file can't be "decently…
Sven Barth wrote 6 lines
> Lazarus (including packages) and free pascal are cross-platform tools supporting multiple Archs and CPUs. So an "obj" file can't be "decently supported" as it will work just on a single CPU/OS combination. Please don't assume that only because one /can/ write cross platform code with FPC/Lazarus that one must do so. ;)

Right, my reasons to want to move these programs is different.
- Weariness with Emabracdero lack of user support
- Want to investigate the use of a *working* 64 bit compiler
- Working user P2P support forum available 24/7

I am not going mobile with these programs either, but we are developing Android Apps using the Andoid Studio.
One reason to get XE5 in 2013 was to test the support for mobile applications with Delphi, but we are using the industry standard toolls here instead.

Can Lazarus do Android platform apps?

Bo Berglund Developer in Sweden

Reply by email

Graeme Geldenhuys
to Bo Berglund: On Tue, 16 Jun 2015 15:47:35 +0200, Michael Schnell OK, then I understand. Might not be…
Bo Berglund wrote
So even though I have used Delphi since 1995 (D1-D2-D3-D4-D5-D7-(long time use)-BDS2006-D2007-XE5-XE7 I am now feeling weary of it all...

I fully agree with everything you have said. In fact I too gave up on their always down "support newsgroup". Pathetic that they can't fix it. I host my own news servers for various open source projects, and never had such bad down time in the 7 years I've been doing it.

EMBT outprice most single or small development teams too. Just crazy. I don't know what they are thinking (if at all).

Luckily we foresaw this downfall years ago, and we moved all our products to FPC, Lazarus and fpGUI. We can't be happier now, and never looked back.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

waldo kitty
to Bo Berglund: On Tue, 16 Jun 2015 17:13:42 +0200, Sven Barth Right, my reasons to want to move these…
Bo Berglund wrote
Can Lazarus do Android platform apps?

errrmmm... it could the last time i looked... i don't do android or any small devices like that but there's been a lot of discussion and work on that capability over the last several years ;)

NOTE: No off-list assistance is given without prior approval. Please *keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

Sven Barth
to Bo Berglund: On Mon, 15 Jun 2015 09:33:03 +0100, Graeme Geldenhuys Well I tried reading the docs first…
"Bo Berglund" wrote 10 lines
>If you could consider alternatives, then you could take a look at the >FPC port of Turbo Power's OnGuard. I've been using this for years in a >commercial environment creating trial versions, leased software etc. My >port is available on Github [https://github.com/graemeg/onguard], but I >believe another port is floating around somewhere too. Not really possible because we have thousands of customers using the software which I am now considering porting to Lazarus. So I definitely need to keep going with the SuperPro system. I think I will ask the support at SafeNet for their views.

Maybe you can ask them to provide FPC compiled object files for the platforms you need (under the assumption that their code is portable enough). You'd need the .ppu and .o file and you'd have to stick to the same compiler version (and if they depend on the LCL also same Lazarus version). Thus I'd wait with that till FPC 3.0.0 is released in (hopefully) a few months as FPC 2.6.4 is nearing EoL. Of course you can already check back with SafeNet if they'd provide you with binaries or even better the source.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150617/fcbdcee4/attachment.html>

Reply by email

Michael Van Canneyt
to aradeonas
aradeonas wrote 5 lines
Can Lazarus do Android platform apps? ? Yes but its wrong and I didn't saw any good new-age-look app with it.

Why ?

If you use the JVM compiler, the app uses the Java SDK, and it will look exactly like the android native apps look, because then it IS a native android app.

Of course, you can't use the LCL then.

Michael

Reply by email

Graeme Geldenhuys
to Sven Barth: Maybe you can ask them to provide FPC compiled object files for the platforms you need…
Sven Barth wrote
Of course you can already check back with SafeNet if they'd provide you with binaries or even better the source.

[I know it is a bit late for the original posted]

For that reason I refuse to purchase any software components that don't include full source code. Some ISV's can be very slack with support, or very slow to progress. eg: Digital Metaphors don't support FPC or Lazarus with their ReportBuilder product. Yet I knew somebody that bought it will full source code, and managed to port it themselves. Full source code gives you that option, and you don't have to be locked in or at the mercy of the ISV.

Either way, it is good to ask the ISV's to support Free Pascal and Lazarus. Always raise the interest.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Graeme Geldenhuys
to Michael Schnell
Michael Schnell wrote
All that is rather queer with an open source IDE.

Closed source 3rd part stuff might be problematic.

As for imposing copy protection on software... I have no problem with do it myself, otherwise how am I going to make money off software that took me years to develop. Not everything in this world needs to be open source. Developers need to make a living too. I know this is a fine line. eg: I personally think development tools (compiler, IDE and debugger) should be open source. 3rd Party components should come with source code, and applications being developed can be anything.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

aradeonas
to Graeme Geldenhuys
Yes but its wrong

Wrong is typo here but its likely to be true.In Android and iOS I didn't saw ant foreign language do a good job.If you saw any good app with beautiful standard UI tell me.

I mean if they are going with AsndroidStudio probably they should continue with that,just compiling for a device is not a good reason to make app with it.

Regards, Ara

http://www.fastmail.com - Send your email first class -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150617/9d92620b/attachment.html>

Reply by email

Mark Morgan Lloyd
to Michael Schnell: He also wants to use closed source 3rd party stuff and want to impose copy protection to…
Michael Schnell wrote
He also wants to use closed source 3rd party stuff and want to impose copy protection to his projects. All that is rather queer with an open source IDE.

Why? It's not as though he's trying to add non-open components to the published IDE and expecting other people to use them, and since there's no requirement to publish stuff you build using an "open" license (GPL etc.) I don't see that putting copy protection on it makes any format of binary-distributed libraries etc. could prove to be more of a problem, and consulting Jonas et al. in the fpc-pascal mailing list might be necessary. However I would say that while I recognise that changing the protection "dongle" is obviously a non-starter, I'd be very suspicious of any protection scheme which relies on unpublished source code: such a thing would smack of "security by obscurity" which is universally considered to be a Bad Thing.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Lukasz Sokol
to aradeonas: Wrong is typo here but its likely to be true.In Android and iOS I didn't saw ant foreign…
aradeonas wrote 13 lines
Yes but its wrong Wrong is typo here but its likely to be true.In Android and iOS I didn't saw ant foreign language do a good job.If you saw any good app with beautiful standard UI tell me. I mean if they are going with AsndroidStudio probably they should continue with that,just compiling for a device is not a good reason to make app with it. Regards, Ara

<OT rant>
I tried Android Studio, only just a simple example project (bluetooth chat with mods) import (mods to make the bluetooth part connect to a bluetooth-serial type endpoint)...

It is painful.

They went to great lengths to name every other element of that ecosystem DIFFERENT than people coming from other contexts may recognize.

I mean, you know what an 'activity' is ? At first glance? ...

The standard controls are well, standard; and no clear path/explanation to install any non-standard ones (like, how would you program up something like analog gamepad buttons?)

(one might just about recognize a Button class, and c&p its creation&usage to get what one wants, within the bounds of same class... ok it works... even got progress/trackbars to work as joysticks... but the rest is so baroque and unhelpful and unintuitive, I can't bear to look at it any more... too many variables. oh, and what is a 'listener' again ?)

Now try merging code from another example (e.g. accelerometer/gyroscope handling) with the serial bluetooth dongle/chat example. In Java.

I'm still struggling.

Not helped by, that my 4 year old i5 24XX CPU turns its fan into a small jetplane (noise-wize) wile just browsing code trying to figure things out for more than half an hour. </ OT rant>

el es

Reply by email

aradeonas
to Lukasz Sokol

Android and AndroidStudio are bad against Lazarus? Yea I think but it has power of millions of users and it has a standard for UI and its good so if any programming language want to play it its field it need to be clean as native but easier to write with a better structure.

Regards,
Ara

http://www.fastmail.com - Does exactly what it says on the tin

Reply by email

Lukasz Sokol
to aradeonas
aradeonas wrote
Android and AndroidStudio are bad against Lazarus?

Well I can see the difference and to me Lazarus is the winner here and now.

Yea I think but it has power of millions of users

maybe, like some not exactly fresh meat has too ;)

and it has a standard for UI and its good

the 'good' part is that it doesn't crash unexpectedly ;) but I found some ways to get a project built, without warnings or errors, and then have it not run on the target device while programming a listener for a button...

(luckily it was just some implementations missing while c&p programming, so it was semi-not frightening already )

the whole Android-Java thing is a right nightmare to comprehend, to me.

so if any programming language want to play it its field it need to be clean as native but easier to write with a better structure.

Which is what my rant was actually about :J

Regards, Ara

Regards
el es

Reply by email

leledumbo
to aradeonas: Wrong is typo here but its likely to be true.In Android and iOS I didn't saw ant foreign…
just compiling for a device is not a good reason to make app with it.

then maybe big, core functionality, non-UI code sharing between mobile, desktop and web platforms would be a good one. no LCL, but at least RAD style development with lazandroidmodulewizard is fun enough.

Reply by email

aradeonas
to leledumbo
fun enough

Sure. exciting ? yes. But enough for doing what you can do with Native tools? No. Even Delphi with XE series and advertising about Android and iOS is not good choice. I agree if you want to make a professional tool for multi platform including Android ,Lazarus is very good but I like to see for example Material UI app made with Lazarus too.

Regards, Ara

http://www.fastmail.com - Email service worth paying for. Try it for free -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150618/63aa099b/attachment.html>

Reply by email

Michael Van Canneyt
to aradeonas
aradeonas wrote 6 lines
fun enough Sure. exciting ? yes. But enough for doing what you can do with Native tools? No. Even Delphi with XE series and advertising about Android and iOS is not good choice. I agree if you want to make a professional tool for multi platform including Android ,Lazarus is very good but I like to see for example Material UI app made with Lazarus too.

I agree, but it takes manpower to do all this.

Michael.

Reply by email

Bo Berglund
to Michael Schnell: He also wants to use closed source 3rd party stuff and want to impose copy protection to…
Michael Schnell wrote 6 lines
On 06/16/2015 06:14 PM, Graeme Geldenhuys wrote: > Being open source and allowing me to customise things the way I like > is a brilliant feature. He also wants to use closed source 3rd party stuff and want to impose copy protection to his projects. All that is rather queer with an open source IDE.

This is unfair!
We had a PhD hired for 8 years to complete the data analysis and presentation software for tomographic analysis. He was brilliant at his science but not so good at programming, I have discovered. Now I need to maintain the software suite while we try to get back the investment.
Doing so with Embarcadero's software is progressively harder all the time due to their miserable support policy.

That is why I am investigating the possibilities to port the applications to FPC and Lazarus. Should it be possible then I will probably have to spend a number of months doing it (hopefully less).' But in the end we still need the dongled protection because the package is a scientific analysis software suite and it is sold in maybe 100 copies yearly.

The dongles ensure we at least get paid from official customers.

This has nothing whatsoever to do with the way the developmemnt is done or which compiler is used.

Back to my technical discussion:
--------------------------------
Concerning Safenet I tried to access their support portal (which I have used frequently in the past) only to discover that they have moved to a new portal and apparently NOT migrated the registered users...
So now I have to wait a while for my login to be created before I can ask for FreePascal support.

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund
Bo Berglund wrote 6 lines
Concerning Safenet I tried to access their support portal (which I have used frequently in the past) only to discover that they have moved to a new portal and apparently NOT migrated the registered users... So now I have to wait a while for my login to be created before I can ask for FreePascal support.

Remember that in general FPC can link to C (but not necessarily C++) libraries.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Bo Berglund
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 12 lines
Bo Berglund wrote: > Concerning Safenet I tried to access their support portal (which I > have used frequently in the past) only to discover that they have > moved to a new portal and apparently NOT migrated the registered > users... > So now I have to wait a while for my login to be created before I can > ask for FreePascal support. Remember that in general FPC can link to C (but not necessarily C++) libraries.

I have their API decription and I have an obj file SPROMEPS.OBJ, which I think contains the interface towards the actual driver. But how can I find out if this can be used with FPC?

In the pas file referencing the obj file I have this:

IMPLEMENTATION
USES
   Windows;
{$L SPROMEPS.OBJ}  { LINK WITH THE SUPERPRO OBJECT FILE }
{ External functions }
FUNCTION RNBOsproFormatPacket( ApiPacket     : RB_SPRO_APIPACKET_PTR;
                               thePacketSize : WORD ) : WORD; STDCALL;
EXTERNAL;

Any ideas?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund: I am investigating if I will have any chance to switch to Lazarus/FPC from Delphi with…
Bo Berglund wrote 14 lines
1) We have created a number of non-visual components that are dropped on the forms to supply various kinds of functionality. Some of these are handlers for language dependent texts, software protection dongles, communications interfaces like RS232 serial components, logging functions etc. Seems like non-visual components are not handled by Lazarus according to wiki texts I have read. 6) An important non-visual component on almost all of our applications is a handler I wrote a long time ago (about 2000) for the Safenet Sentinel Superpro software protection dongle. It is mostly my own code but it uses pas and an obj file supplied from Safenet. If Lazarus does not work with this obj file then I would be dead in the water... How can I find out?

I might add that the solution was created a long time ago when the concept of using components to be dropped on datamodules was what we used.
However, this dongle component can equally well be used without being dropped anywhere, it is just another class really. I would not have a problem using it as a general purpose object and changing my programs accordingly, that would be pretty easy, provided I can make it work in Lazarus/FPC.

Bo Berglund Developer in Sweden

Reply by email

Graeme Geldenhuys
to Bo Berglund
Bo Berglund wrote
I would not have a problem using it as a general purpose object and changing my programs accordingly, that would be pretty easy, provided I can make it work in Lazarus/FPC.

(never tried, never used .obj files since Turbo Pascal days)

If all else fails with using the .obj file directly with FPC, what about using the .obj file in Delphi and create a DLL, which you can then use from FPC. Could that work?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Bo Berglund
to Graeme Geldenhuys
Graeme Geldenhuys wrote 11 lines
On 2015-06-18 17:48, Bo Berglund wrote: > I would not have a problem using it as a general purpose object and > changing my programs accordingly, that would be pretty easy, provided > I can make it work in Lazarus/FPC. (never tried, never used .obj files since Turbo Pascal days) If all else fails with using the .obj file directly with FPC, what about using the .obj file in Delphi and create a DLL, which you can then use from FPC. Could that work?

It might...
I have thought that if I start out with Lazarus (installed but not yet started) by creating a small application where I include the sources for the dongle component after stripping out the component related stuff, then I could have a minimalistic project to figure out... Of course I could create a Delphi DLL exporting the important functions (basically those published by the component) and use that. Did not think about that kind of solution, but it would probably work. There could be a vulnerability for hacking, though, since someone couls create a fake dll with the same interface and this way circumvent our protection...

Bo Berglund Developer in Sweden

Reply by email

ListMember
to Bo Berglund
Bo Berglund wrote
There could be a vulnerability for hacking, though, since someone couls create a fake dll with the same interface and this way circumvent our protection...

You could add another function to that DLL and do an authentication handshake (to check that the DLL is genuine) before calling anything else in that DLL.

I know this isn't waterproof but if someone is determined/talented enough, they can bypass your dongle component too even if it was embedded in your exe.

Reply by email

Graeme Geldenhuys
to Bo Berglund: On Thu, 18 Jun 2015 20:02:02 +0100, Graeme Geldenhuys It might... I have thought that if…
Bo Berglund wrote
for the dongle component after stripping out the component related stuff, then I could have a minimalistic project to figure out...

That is exactly what we did back in 2006/7 when we evaluated the possibility of moving our Delphi code to FPC. We noted all the component requirements from our various projects. Then created many small tests to see what would be needed, and what works and what doesn't. In the end this process worked out very well for us.

It was also a good time for us to get rid of some components, and replace them with standard components, our own custom components, or open source alternatives. Having less 3rd party dependencies was a huge plus point, but I do know sometimes it is unavoidable.

Would you believe it, we still have a Visual Basic 6 machine we can't replace or reinstall. This system was originally setup 13 years ago. The hardware finally started to fail, but just before the hard drives gave up, we cloned it to a VMWare VM. We couldn't create a new VM from scratch because we can't find all the required 3rd party (closed source) components, and don't know where the licensing keys are for them either. VM's to the rescue!! :)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Schnell
to Bo Berglund: On Thu, 18 Jun 2015 15:08:19 +0000, Mark Morgan Lloyd I have their API decription and I…
Bo Berglund wrote 13 lines
In the pas file referencing the obj file I have this: IMPLEMENTATION USES Windows; {$L SPROMEPS.OBJ} { LINK WITH THE SUPERPRO OBJECT FILE } { External functions } FUNCTION RNBOsproFormatPacket( ApiPacket : RB_SPRO_APIPACKET_PTR; thePacketSize : WORD ) : WORD; STDCALL; EXTERNAL;

It uses e.g. "STDCALL", so supposedly it is an ANSI C based interface.

If the obj file format is not GNU/FPC compatible and can't be used by the linker in fpc, " Safenet" might be able to provide a GNU C version of that file.

But being able to successfully link might not be enough. It might be possible that the Safenet thingy does some encryption with the exe information file to allow only execution only if the correct dongle is found. That might or might not be compatible with fpc generated exes.

Reply by email

Mark Morgan Lloyd
to Michael Schnell: It uses e.g. "STDCALL", so supposedly it is an ANSI C based interface. If the obj file…
Michael Schnell wrote 20 lines
On 06/18/2015 06:01 PM, Bo Berglund wrote: > In the pas file referencing the obj file I have this: > > IMPLEMENTATION > USES > Windows; > {$L SPROMEPS.OBJ} { LINK WITH THE SUPERPRO OBJECT FILE } > > { External functions } > FUNCTION RNBOsproFormatPacket( ApiPacket : RB_SPRO_APIPACKET_PTR; > thePacketSize : WORD ) : WORD; STDCALL; > EXTERNAL; > > It uses e.g. "STDCALL", so supposedly it is an ANSI C based interface. If the obj file format is not GNU/FPC compatible and can't be used by the linker in fpc, " Safenet" might be able to provide a GNU C version of that file.

I can't safely comment on Windows-specific issues, we gave that up years ago (the hassle of accounting for every copy on various experimental machines etc. was more than it was worth).

Assuming standard linkage conventions the function should "just work", but the definition of RB_SPRO_APIPACKET_PTR might need checking.

But being able to successfully link might not be enough. It might be possible that the Safenet thingy does some encryption with the exe information file to allow only execution only if the correct dongle is found. That might or might not be compatible with fpc generated exes.

But as a cautionary tale, a colleague who didn't know x86 assembler once spent many lunchtimes stepping through AutoCAD to break their dongle lookup so that he could do something like running a slightly older (but more comprehensive) version than he'd got a formal license for. "Security by obscurity" doesn't work, particularly on an open system like a PC.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email