Recent

Author Topic: Variables between a form and a DLL  (Read 948 times)

dbannon

  • Hero Member
  • *****
  • Posts: 1149
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Variables between a form and a DLL
« Reply #15 on: February 25, 2020, 04:46:08 am »
CodeTyphon makes cross compiling lots easier. Lazarus/FPC can do cross compiling, the documentation is there. But learning it is not easy. I spent many weeks just to be able to cross compile from Linux to Windows.
Really ?  I am sure I posted my notes about how to setup cross compiling from Ubuntu64 to Win32, Win64 and Linux32. It was just collected from other notes in the wiki. Maybe it needs to live in the Short Tutorial Page you asked about ?  https://forum.lazarus.freepascal.org/index.php/topic,48264.msg347466.html#msg347466

Its really only building the necessary bits for FPC, Lazarus is ready out of the box.

....
Lazarus has LAMW, OPM, bug tracker. And the community has a lot of experience users, they share their experience, codes and tricks. I always learn something new just simply reading the posts on the forum.

That little list alone is conclusive !   OPM is fantastic and this community is amazing !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Handoko

  • Hero Member
  • *****
  • Posts: 3762
  • My goal: build my own game engine using Lazarus
Re: Variables between a form and a DLL
« Reply #16 on: February 25, 2020, 05:57:35 am »
I am sure I posted my notes about how to setup cross compiling from Ubuntu64 to Win32, Win64 and Linux32.

Thank you for the notes. But if I remember correctly you haven't posted those notes when I was learning how to do cross compiling. I found the documentation explaining how to do cross compiling but that information wasn't clear. I searched and read a lot of info from forum and did many experiments finally I managed to do it. The most useful information was from Leledumbo.

The documentation was there. But the explanation was not beginner friendly.

PascalDragon

  • Hero Member
  • *****
  • Posts: 2135
  • Compiler Developer
Re: Variables between a form and a DLL
« Reply #17 on: February 25, 2020, 09:26:04 am »
Wow... it works in CT but no in Lazarus. Really?
Anybody else would like to help me, please?

Code like this can work by accident. It depends on the operating system used and how the operating system loads the involved binaries. This does in no way guarantee that it will work every time, neither in Lazarus nor in CT nor in pure FPC.

If you want to pass data between libraries and a main program you must currently either use manual memory management and types like PChar (just as if you'd interface with a C library or have a Pascal library used in C) or you need to at least use a shared memory manager, then you can use types like String as well. However classes and exceptions are still of limits then. Only dynamic packages will solve that problem completely.

 

TinyPortal © 2005-2018