Recent

Author Topic: Did somebody succeed with convert Tcomport ?  (Read 5423 times)

Souch

  • Newbie
  • Posts: 2
Did somebody succeed with convert Tcomport ?
« on: July 26, 2006, 11:27:49 am »
Hi,

I try to convert comport 3 package (from delphi version) to lazarus, but it use Windows.pas, winspool.pas and some others parts of code that seems to be not compatible. I work on it but i'm a beginner on unit convertion ^^

If you have succesfully convert this package, or if you know something who look like TComport, i'm really interested !!

Many thanks,

Souch

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Did somebody succeed with convert Tcomport ?
« Reply #1 on: July 26, 2006, 06:06:11 pm »
Quote from: "Souch"
I try to convert comport 3 package (from delphi version) to lazarus, but it use Windows.pas, winspool.pas and some others parts of code that seems to be not compatible.


Just implement those parts differently on each platform. Do like this:

uses
$ifdef win32
  Windows, winspool,
$endif
$ifdef unix
  Unix,
$endif
  otherunits;

And then on every function that depends on Windows API calls, do this:

$ifdef win32
  Call WinAPI
$endif
$ifdef unix
  Use a UNIX API, a glibc API, or another library
$endif

Try to implements parts differently on each platform, but in such a way that the final result works.

The ifdefs must be enclosed by braces. Sorry, this keyboard doesn`t have those keys.

Souch

  • Newbie
  • Posts: 2
Did somebody succeed with convert Tcomport ?
« Reply #2 on: July 27, 2006, 11:06:29 am »
Many thanks, i will try it !!

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Did somebody succeed with convert Tcomport ?
« Reply #3 on: July 27, 2006, 08:07:53 pm »
Maybe Synapse's "synaser" helps:

http://synapse.ararat.cz/