Recent

Author Topic: Linux analog of windows mesages  (Read 2854 times)

Baltazar

  • New Member
  • *
  • Posts: 12
Linux analog of windows mesages
« on: March 29, 2019, 02:31:44 am »
Hi Guys!
I am not a Linux guy but if I want to port my lazarus apps to Linux , where can I find the guidelines  say, to port windows messaging code to Linux counterpart?

benohb

  • Full Member
  • ***
  • Posts: 218
Re: Linux analog of windows mesages
« Reply #1 on: March 29, 2019, 04:28:30 am »

On Linux will be more freely programmatically

What do you mean "windows messaging code"

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Linux analog of windows mesages
« Reply #2 on: March 29, 2019, 05:28:57 am »
Hi Guys!
I am not a Linux guy but if I want to port my lazarus apps to Linux , where can I find the guidelines  say, to port windows messaging code to Linux counterpart?
Linux doesn't use message passing, most of its API calls are direct function call. But LCL has an abstraction of it that works across all supported platforms: http://wiki.lazarus.freepascal.org/LCL_Messages
There's no definitive guide AFAIK, but a common rule is: http://wiki.lazarus.freepascal.org/Code_Conversion_Guide#Major_unit_differences_between_Lazarus_and_Delphi
Note that not every messages are available in both, but there are common subset.

Thaddy

  • Hero Member
  • *****
  • Posts: 19383
  • Glad to be alive.
Re: Linux analog of windows mesages
« Reply #3 on: March 29, 2019, 08:35:17 am »
The first thing you should try is simply recompile on linux.
If your code relies heavily on low-level message passing you can run into trouble, though. (e.g using the platform specific  windows unit instead of lclintf and family)
You can ask questions here on a case per case basis for the ones you can not solve yourself.
objects are fine constructs. You can even initialize them with constructors.

Baltazar

  • New Member
  • *
  • Posts: 12
Re: Linux analog of windows mesages
« Reply #4 on: March 29, 2019, 11:36:23 am »
Thank you all. I think the info from @LeleDumbo is sufficient.

Quote
What do you mean "windows messaging code"
Sorry for compounded statement  :D . It only means part of source codes having Windows messaging API calls.

I am not a WinAPI heavy user though. It's just for those stuff like MDI forms created at runtime. The only way to access its public members  is through APIs (ie use of handles) and not through standard VCL access mechanism.

Thaddy

  • Hero Member
  • *****
  • Posts: 19383
  • Glad to be alive.
Re: Linux analog of windows mesages
« Reply #5 on: March 29, 2019, 12:06:06 pm »
Well, MDI is notoriously difficult to port....
objects are fine constructs. You can even initialize them with constructors.

Baltazar

  • New Member
  • *
  • Posts: 12
Re: Linux analog of windows mesages
« Reply #6 on: March 29, 2019, 01:03:05 pm »
Yup. I am exploring now the TDI.

 

TinyPortal © 2005-2018