Lazarus

Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: von_ks on February 03, 2009, 11:49:56 am

Title: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 11:49:56 am
Hi all

I have problem with converting an opensource freeware Programm to lazarus.
The name of this programm is SEBRAN and is writen by delphi.
It is a programm for kids and I want to modify it for my little son.
can sombody help me and give me some tips how can I do that ??
The link of the source code is http://www.wartoft.nu/software/sebran/sebran_139_source.zip

thanks
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 11:58:25 am
See the documents in the wiki for people coming from Delphi (http://wiki.lazarus.freepascal.org/Lazarus_Documentation#Coming_from_Delphi).
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 12:07:54 pm
I have just read it, and I have tried it, but no seccess, and so I come here to find mor information and some help.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 12:10:43 pm
What doesn't work?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 12:22:35 pm
Hi

I am not sure.
There are several files to have be compiled and work together.
first I wanted to convert ist separatly but it did not work, so I have made a package and tried it again but it did not work either.
The only thing that has worked, was converting dfm file to lfm file.
But no chance by .pas file and I am wondering if it is passible at all.
 
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 12:25:36 pm
I think it is possible, but if all you can say, that is doesn't work, then I cannot help you.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 01:21:46 pm
which information do you need ?
I send you now the message for compiling the package.

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling .\sebran\Delphi4\GENERELL.PAS
D:\Temp\sebran\Delphi4\GENERELL.PAS(1,1) Fatal: Can't find unit WinTypes used by Generell

kind regards
Kawous
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 01:26:48 pm
Yes, that is clear information. Now I can see what doesn't work and what goes wrong.

AFAIK, wintypes is replaced by windows unit in later delphi version. If you compile for windows, you can try to replace it by the windows unit of fpc.

If you want to be able to target other Lazarus targets later (Linux, Mac OS X), then you should use the LCLIntf and/or the LCLType unit.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 01:41:46 pm


first thank you for information !
I am using windows XP SP2.
but I have now more question.
where is the windows unit for fpc ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 01:49:13 pm
where is the windows unit for fpc ?
In the place where the fpc RTL units are installed. If you don't know, just replace wintypes with windows and compile.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 02:01:53 pm

It seems to be many of them.
Now comes the message that can not find the unit WinProcs.
should it be also replaced ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 02:03:36 pm
Yes. Really, these units are from 16 bits windows time, IIRC. I hope it did compile with Delphi 4...
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 02:11:35 pm


It can not compile with IIRC .
the same message .
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 02:16:58 pm
See IIRC (http://en.wiktionary.org/wiki/IIRC).

The units wintypes and winprocs both have been replaced with the windows unit (since Delphi 2 or Delphi 3).
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 02:23:31 pm

now it has problem with the unit Graphics

and here are all units used by the part generell
SysUtils, Windows, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, ExtCtrls, Fileread, MPlayer;

Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 02:34:57 pm
Add the LCL as requirement to your application in the

now it has problem with the unit Graphics
Add the LCL as requirement to your project in the project inspector.
Quote
and here are all units used by the part generell
SysUtils, Windows, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, ExtCtrls, Fileread, MPlayer;
Fileread and MPlayer are not LCL or FPC units as far as I know. If you don't have the source of them, you can stop the port now.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 03:29:53 pm


I think I have done it.
How can I compile it ?
With the start butoom I get the same massages.
It can not find unit Graphics .
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 03, 2009, 04:28:26 pm

I still need help
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 03, 2009, 04:36:11 pm
Well, I don't know why it doesn't work, so I cannot help you.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 04, 2009, 04:41:18 am
What about checking whether a unit named Graphics exists in the project directory? If yes, then it will conflict with Graphics unit from LCL. Try renaming it.

Messages window doesn't show everything emitted by FPC. Right click and choose 'copy all and hidden messages', then paste it somewhere (or here so we can help you) so you can examine it. Using -vt compiler option might also help.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 04, 2009, 11:05:54 am

tanx

the problem is not solved.
I am still trying to understand lazarus and how it works.
And I can say it is not easy. And I have so many questions.
I found something yesterdy about to rename of graphics in the documentation. so I have to check it too.

Kawous
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 05, 2009, 12:58:03 pm
Hi

that is the messages made by compiler now.
Could  you tell me please what can I do now ?

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\lazarus\lcl\xmlpropstorage.pas
Compiling D:\lazarus\lcl\fileutil.pas
Compiling D:\lazarus\lcl\lclstrconsts.pas
Writing Resource String Table file: lclstrconsts.rst
Compiling D:\lazarus\lcl\masks.pas
Compiling D:\lazarus\lcl\lclproc.pas
Compiling D:\lazarus\lcl\fpcadds.pas
Compiling D:\lazarus\lcl\avglvltree.pas
D:\lazarus\lcl\avglvltree.pas(1182,16) Hint: Local variable "List" does not seem to be initialized
Compiling D:\lazarus\lcl\fileutil.pas
D:\lazarus\lcl\fileutil.pas(237,2) Fatal: Can't open include file "fileutil.inc"

Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 05, 2009, 01:32:29 pm
You just have messed up your Lazarus installation by adding LCL source paths to the unit paths.

The best way to undo is to re-install Lazarus in a new directory.

Why did you add the LCL source paths? That should not be necessary, if you really added the LCL as dependency to your project. If you wish to recompile the LCL, for example because you have installed a new fpc compiler, use Tools -> Configure Build Lazarus.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 05, 2009, 02:46:08 pm

Hi Vincent

Problem with finding fpc.
please look to the attachment. zip file.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 05, 2009, 02:55:29 pm
Does the file c:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.exe exist? Or did you accidentially delete it? The file is installed by a lazarus installer with fpc 2.2.2. If you changed fpc versions, then you need to change the path to the compiler in the environment options.

I saw you correctly added the LCL as requirement to your project.

The compilation error you got, were while compiling the package. So add the LCL as requirement to your package too.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 05, 2009, 03:10:41 pm


I have first deinstalled the lazarus and reinstalled it in a new directory as you told in lazarusA.
should I install it again in directory lazarus ?
And when I try to add LCL to package I have only the choice to add files and I can add LCL's just as files. Is that correct ?
How can I else add LCL to packege ?
regarding to my experince and regarding to document the .pas file should be enterd  after LCL's is that correct ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 05, 2009, 03:53:50 pm


I have first deinstalled the lazarus and reinstalled it in a new directory as you told in lazarusA.
should I install it again in directory lazarus ?
Or adapt the paths in the environment options to the new lazarus directory.

Quote
And when I try to add LCL to package I have only the choice to add files and I can add LCL's just as files. Is that correct ?
No. In the package editor, click on the add button and choose for the requirements tab. Choose the LCL package.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 05, 2009, 04:47:09 pm

Hi

that is the result

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling .\sebran\Delphi4\FILEREAD.PAS
PPU Loading D:\lazarus\lcl\units\i386-win32\fileutil.ppu
Recompiling FileUtil, checksum changed for LCLStrConsts
D:\Temp\sebran\Delphi4\FILEREAD.PAS(1,1) Fatal: Can't find unit FileUtil used by LResources

and my configuration can you see in attached zip file.

Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 06, 2009, 04:45:39 am
Another unit conflict? Search all units (.o, .ppu, libxxx.a if any) with same name and make sure they don't conflict with LCL. If you're sure everything is alright, try rebuilding LCL.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 06, 2009, 06:47:04 am
More likely, there are still some LCL ppu is the component's dirs and subdirs.
Remove all the .ppus from the component's directory and subdirectories.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 06, 2009, 02:33:43 pm


Hi

I have deleted *.ppu files in the componets directory and subdirctories of it.
it did not help but when I delete it in the Temp direktory
so I could come another step forwards.
Now the compiler deliever this messeage.

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling .\sebran\Delphi4\FILEREAD.PAS
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,3) Note: Local variable "b" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,6) Note: Local variable "b2" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(163,3) Note: Local variable "code" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
D:\Temp\sebran\Delphi4\FILEREAD.PAS(237,5) Note: Local variable "i" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(238,5) Note: Local variable "NyStr" not used
Compiling .\sebran\Delphi4\GENERELL.PAS
D:\Temp\sebran\Delphi4\GENERELL.PAS(1,1) Fatal: Can't find unit MPlayer used by Generell

can I do something with Mplayer ?
is the order of .pas files the problem ?

kind regards
Kawous

Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 06, 2009, 03:49:25 pm
I guess, Delphi has a mplayer unit. Lazarus has not. That is why I said a couple of days ago, that if you don't have the source code of the mplayer unit, you can stop the porting. You must remove it from the uses clause and find or write replacements procedure and functions for the functions and procedures that are in the mplayer unit.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Phil on February 06, 2009, 06:49:43 pm
It depends on what he needs to do with Media Player. If he just needs to play something (.mid, .avi file, etc.) he could just do a ShellExecute to the mplayer2.exe installed on the computer and pass the path to the file. This will launch the MS Media Player external to his app and open the file.

If he's using the Delphi MPlayer unit's TMediaPlayer component to provide a "VCR-type" set of controls on a form, then that's not available with Lazarus.

Thanks.

-Phil
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 06, 2009, 07:52:00 pm
Phil, good point, well explained. Thanks for the help.

That is what I more or less wanted to say with a re-implementation of mplayer, which can be easy, as you explained or hard if you want to show some VCR controls.

But even for showing controls, there are component on Lazarus CCR, IIRC.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Phil on February 06, 2009, 09:46:34 pm
Do you mean ACS? Recent posts seem to indicate that ACS doesn't work very well and never worked for OS X.

Sebran: Maybe you could post a small bounty for fixing ACS if indeed it doesn't work very well on Windows.

Thanks.

-Phil
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 06, 2009, 09:56:18 pm
Do you mean ACS?
No I was thinking about http://wiki.lazarus.freepascal.org/RackCtls
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 07, 2009, 12:08:33 am

Hi

sebran just use some sounds for giving some good or bad singnals for the kids. and some small music sounds after a play.
there is nothing with video.
can I use RackCtls instead of MPlayer ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 07, 2009, 03:45:03 pm
I don't think so. RackCtls are just the visible controls.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 09, 2009, 09:51:27 am
Hi

I have found a source code . But I have some questions ?
and I am not sure if it is the right one.

does lazarus support all this units ?

uses Windows, Classes, Controls, Forms, Graphics, Messages,
  MMSystem, Dialogs, SysUtils;

Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 09, 2009, 12:45:52 pm
On windows, yes.

The MMSystem unit is windows only and there is not simple replacement for it.

The Windows unit is for windows only too, but some windows functions can be found in the LCLIntf unit.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 09, 2009, 02:36:18 pm
Hi

There is one more unit does not work. consts

can I replace that ?

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(237,6) Fatal: Can't find unit Consts used by MPlayer


kind regards
Kawous
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 09, 2009, 02:38:27 pm
I don't know the unit consts.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 09, 2009, 03:27:11 pm


Hi

So I have found also consts.pas and now I get this compiler message.
I am very disapointed but I would like to do that.
what do you think about this message ?

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\Consts.pas
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(503,14) Error: Identifier not found "BrushCopy"
D:\Temp\MPlayer.pas(790,65) Error: Identifier not found "sNotOpenErr"
D:\Temp\MPlayer.pas(830,32) Error: Illegal type conversion: "ShortString" to "^Char"
D:\Temp\MPlayer.pas(848,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(898,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(943,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(978,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1000,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1005,65) Error: Identifier not found "sNotOpenErr"
D:\Temp\MPlayer.pas(1030,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1050,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1110,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1168,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1196,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1202,3) Error: Duplicate identifier "Error"
D:\Temp\MPlayer.pas(1202,3) Hint: Identifier already defined in MPlayer.pas at line 182
D:\Temp\MPlayer.pas(1240,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1267,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1288,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1314,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1324,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,28) Error: Illegal type conversion: "ShortString" to "^Char"
D:\Temp\MPlayer.pas(1373,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1417,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1431,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1465,61) Hint: Conversion between ordinals and pointers is not portable

D:\Temp\MPlayer.pas(1487,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1501,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1518,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1523,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1528,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1533,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1538,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1547,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1560,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1592,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1602,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1623,3) Error: Identifier not found "SMCIUnknownError"
D:\Temp\MPlayer.pas(1694,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1694,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1695,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1754) Fatal: There were 7 errors compiling module, stopping


Title: Re: convert Sebran delphi(4) code to lazarus
Post by: arnoldb on February 09, 2009, 03:31:10 pm
Consts contains a lot of resource strings in Delphi.

Some of the errors you are getting looks like they are related to the consts unit, or expect to have entries in the consts unit...

Looks like you will have to try to figure out the others.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 09, 2009, 03:37:35 pm

Hi

That was just a statement from me.

What do you recommend me to do now ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 09, 2009, 03:48:35 pm
* Compile the unit in mode Delphi
* BrushCopy is not available in the LCL.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 11, 2009, 09:55:54 am


Hi

There is still one error.
I have choosen delphi mode.
And I tried to find another MPlayer but I did not have success.
Is there a workaround for Brushcopy ?

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(503,14) Error: Identifier not found "BrushCopy"
D:\Temp\MPlayer.pas(848,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(898,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(943,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(978,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1000,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1030,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1050,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1110,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1168,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1196,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1240,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1267,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1288,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1314,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1324,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1373,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1417,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1431,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1465,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1487,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1501,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1518,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1523,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1528,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1533,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1538,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1547,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1560,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1592,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1602,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1694,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1694,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1695,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1754) Fatal: There were 1 errors compiling module, stopping
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 11, 2009, 10:43:11 am
Quote
There is still one error.
I have choosen delphi mode.
And I tried to find another MPlayer but I did not have success.
Is there a workaround for Brushcopy ?
There's no relation between selected mode and available methods (though you might have it so). The workaround is to implement BrushCopy yourself. I've found something in the bug tracker (http://62.166.198.202/view.php?id=8047) that might help.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 11, 2009, 11:11:09 am

Hi

What could be the probelm now ?
Parameter color is missing ?
wrong number of parametr ?



Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(434,42) Hint: Parameter "Color" not used
D:\Temp\MPlayer.pas(515,63) Error: Wrong number of parameters specified for call to "BrushCopy"
D:\Temp\MPlayer.pas(433,11) Hint: Found declaration: BrushCopy(TCanvas,const RECT, TBitmap,const RECT, TGraphicsColor)
D:\Temp\MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1765) Fatal: There were 1 errors compiling module, stopping
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 11, 2009, 02:31:57 pm
Hi

Do you know some other usefull links ?
let me know please.

tanx
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 12, 2009, 05:13:05 am
Would you mind posting the source around the lines where the error occurs (511-520 perhaps)?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 12, 2009, 12:05:08 pm
Hi

The line is programm stopping is the secound one.


    BrushCopy(Bounds(X + BX, BY, Bitmap.Width, Bitmap.Height),
      Bitmap, Rect(0, 0, Bitmap.Width, Bitmap.Height), clOlive);

the cursor is standing after clOlive.

and it happens in procedure Tmediaplayer


procedure TMediaPlayer.DrawButton(Btn: TMPBtnType; X: Integer);
var
  IsDown: Boolean;
  BX, BY: Integer;
  TheGlyph: TMPGlyph;
  Bitmap: TBitmap;
  R: TRect;
begin
  IsDown := Down and (Btn = CurrentButton);
  with Canvas do
  begin
    Brush.Style := bsSolid;
    Brush.Color := clBtnFace;
    Pen.Color := clWindowFrame;
    Pen.Width := 1;
    Rectangle(X, 0, X + ButtonWidth, Height);

    { draw button beveling }
    if IsDown then
    begin
      Pen.Color := clBtnShadow;
      MoveTo(X + 1, Height - 2);
      LineTo(X + 1, 1);
      LineTo(X + ButtonWidth - 1, 1);
    end
    else
    begin
      Pen.Color := clBtnHighlight;
      MoveTo(X + 1, Height - 2);
      LineTo(X + 1, 1);
      LineTo(X + ButtonWidth - 1, 1);
      Pen.Color := clBtnShadow;
      MoveTo(X + 2, Height - 2);
      LineTo(X + ButtonWidth - 2, Height - 2);
      LineTo(X + ButtonWidth - 2, 1);
    end;

    {which bitmap logic - based on Enabled, Colored, and AutoEnable}
    if Enabled or (csDesigning in ComponentState) then
    begin {Enabled only affects buttons at runtime}
      if FAutoEnable and not (csDesigning in ComponentState) then
      begin {AutoEnable only affects buttons at runtime}
        if Buttons[Btn].Auto then {is button available, based on device state}
        begin
          TheGlyph := mgEnabled;
          if Buttons[Btn].Colored then
            TheGlyph := mgColored;
        end
        else TheGlyph := mgDisabled; {button is not available}
      end
      else {when not AutoEnabled or at design-time, check Enabled}
      begin
        if Buttons[Btn].Enabled then
        begin
          TheGlyph := mgEnabled;
          if Buttons[Btn].Colored then
            TheGlyph := mgColored;
        end
        else TheGlyph := mgDisabled;
      end;
    end
    else TheGlyph := mgDisabled; {main switch set to disabled}

    Bitmap := Buttons[Btn].Bitmaps[TheGlyph];
    BX := (ButtonWidth div 2) - (Bitmap.Width div 2);
    BY := (Height div 2) - (Bitmap.Height div 2);
    if IsDown then
    begin
      Inc(BX);
      Inc(BY);
    end;
    BrushCopy(Bounds(X + BX, BY, Bitmap.Width, Bitmap.Height),
      Bitmap, Rect(0, 0, Bitmap.Width, Bitmap.Height), clOlive);
  end;

  if (GetFocus = Handle) and (Btn = FocusedButton) then
  begin
    R := Bounds(X, 0, ButtonWidth, Height);
    InflateRect(R, -3, -3);
    if IsDown then OffsetRect(R, 1, 1);
    DrawFocusRect(Canvas.Handle, R);
  end;
end;   
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 12, 2009, 12:09:20 pm


I have see a site for replacing Brushcopy with CopyRect
but I think it is for linux.
http://wiki.lazarus.freepascal.org/RXfpc/fr
What do you think about that ?

Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 13, 2009, 06:01:28 am
Quote
Wrong number of parameters specified for call to "BrushCopy"
Indeed, the BrushCopy requires 5 parameters while the procedure only calls with 4. The first parameter (TCanvas) seems missing, please specify it.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 13, 2009, 09:07:34 am
could you give me more details how should I specify the missing parameter please ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 13, 2009, 11:28:29 am
What about:
Code: [Select]
BrushCopy(Canvas,Bounds(X + BX, BY, Bitmap.Width, Bitmap.Height),
      Bitmap, Rect(0, 0, Bitmap.Width, Bitmap.Height), clOlive);
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 13, 2009, 11:54:06 am

The problem with Brushcopy seems to be solved.
I came one step forward.
But compiler is now stopped at the End of Mplayer.pas and give the folowing message.

D:\Temp\MPlayer.pas(1762,3) Error: Can't open resource file: MPLAYER.res
D:\Temp\MPlayer.pas(1762,3) Fatal: There were 1 errors compiling module, stopping


here is the whole compiller message

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(434,42) Hint: Parameter "Color" not used
D:\Temp\MPlayer.pas(104,33) Hint: Parameter "YPos" not used
D:\Temp\MPlayer.pas(123,23) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(124,27) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(111,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(113,30) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(115,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(149,38) Hint: Parameter "Shift" not used
D:\Temp\MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
D:\Temp\MPlayer.pas(1762,3) Error: Can't open resource file: MPLAYER.res
D:\Temp\MPlayer.pas(1762,3) Fatal: There were 1 errors compiling module, stopping



Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 13, 2009, 01:13:14 pm
As the error says, is there any mplayer.res in the project dir (or somewhere where the compiler can find)?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Legolas on February 13, 2009, 01:48:19 pm
Try to comment out {$R MPLAYER}
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 13, 2009, 01:53:54 pm


I did not know that is also necessary.
If there is not a workaround so I should find it first.


Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 13, 2009, 02:08:33 pm


I have tried to comment it out but no success.
I think it we should find the MPLAYE.res .
What do you think ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 13, 2009, 02:15:17 pm
Quote
I have tried to comment it out but no success.
Please be more specific. Can you compile the code? Does the executable run? What problems do you get?
Quote
I think it we should find the MPLAYE.res .
You mean, you ;).

Just a side question: How long have you been playing with Lazarus? Or in general, with programming?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 13, 2009, 02:28:44 pm


That is the result when I Try to compile the file.

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(239,14) Fatal: illegal character "'}'" ($7D)

I do not have so many Experience with Lazarus, just few weeks.
But earlear I have developed software.

Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 13, 2009, 02:52:37 pm
uncomment it by adding // at the start of the line.

Delphi and fpc in delphi mode cannot handle nested comments.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Legolas on February 13, 2009, 03:45:33 pm
I have tried to comment it out but no success.
I think it we should find the MPLAYE.res .
What do you think ?

Have you even tried to delete that line at all?
However, as Vincent already have said, there are some problems with nested comments, so you could try to replace it with something like (notice the blank space before "{" ):

Code: [Select]
{ $R MPLAYER }
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 13, 2009, 04:04:20 pm


Hi Vincent

I am glad to see you again.

Yes it could helped. MPlayer is now compiled.

The compiler is now standing at other line at ResultString[0]

 begin
  { Read the string length stored in the first byte. }
  stringLength := ReadByte;

  { Store the string length. }
  {$IFDEF VER90}
  SetLength(ResultString, StringLength);
  {$ELSE}
  ResultString[0] := Chr(StringLength);
  {$ENDIF}

the whole compiler messege is

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(434,42) Hint: Parameter "Color" not used
D:\Temp\MPlayer.pas(104,33) Hint: Parameter "YPos" not used
D:\Temp\MPlayer.pas(123,23) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(124,27) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(111,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(113,30) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(115,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(149,38) Hint: Parameter "Shift" not used
D:\Temp\MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
Compiling .\sebran\Delphi4\FILEREAD.PAS
D:\Temp\sebran\Delphi4\FILEREAD.PAS(175,17) Error: Element zero of an ansi/wide- or longstring can't be accessed, use (set)length instead
D:\Temp\sebran\Delphi4\FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
D:\Temp\sebran\Delphi4\FILEREAD.PAS(249) Fatal: There were 1 errors compiling module, stopping


Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Legolas on February 13, 2009, 04:29:14 pm
The error message is very clear:
Quote
D:\Temp\sebran\Delphi4\FILEREAD.PAS(175,17) Error: Element zero of an ansi/wide- or longstring can't be accessed, use (set)length instead

Looking at line 175 of FILEREAD.PAS:

Code: [Select]
  { Store the string length. }
  {$IFDEF VER90}
  SetLength(ResultString, StringLength);
  {$ELSE}
  ResultString[0] := Chr(StringLength);
  {$ENDIF}

You can remove all that stuff and let in place only:

Code: [Select]
SetLength(ResultString, StringLength);

or you could define VER90 somewhere before that IFDEFs:

Code: [Select]
{$DEFINE VER90}
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 13, 2009, 04:59:59 pm



Fileread is now also compiled



Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(434,42) Hint: Parameter "Color" not used
D:\Temp\MPlayer.pas(104,33) Hint: Parameter "YPos" not used
D:\Temp\MPlayer.pas(123,23) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(124,27) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(111,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(113,30) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(115,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(149,38) Hint: Parameter "Shift" not used
D:\Temp\MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
Compiling .\sebran\Delphi4\FILEREAD.PAS
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,3) Note: Local variable "b" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,6) Note: Local variable "b2" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(163,3) Note: Local variable "code" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
D:\Temp\sebran\Delphi4\FILEREAD.PAS(237,5) Note: Local variable "i" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(238,5) Note: Local variable "NyStr" not used
Compiling .\sebran\Delphi4\GENERELL.PAS
Compiling .\sebran\Delphi4\MESSAGE.PAS
MESSAGE.PAS(41,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(42,30) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,20) Hint: Unit "windows" not used in Message
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,30) Hint: Unit "messages" not used in Message
Compiling resource .\sebran\Delphi4\MESSAGE.DFM
windres: can not determine type of file `.\sebran\Delphi4\MESSAGE.DFM'; use the -J option
MESSAGE.PAS(76,1) Error: Error while linking
Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(434,42) Hint: Parameter "Color" not used
MPlayer.pas(104,33) Hint: Parameter "YPos" not used
MPlayer.pas(123,23) Hint: Parameter "Button" not used
MPlayer.pas(124,27) Hint: Parameter "Button" not used
MPlayer.pas(111,31) Hint: Parameter "Message" not used
MPlayer.pas(113,30) Hint: Parameter "Message" not used
MPlayer.pas(115,31) Hint: Parameter "Message" not used
MPlayer.pas(149,38) Hint: Parameter "Shift" not used
MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
Compiling .\sebran\Delphi4\FILEREAD.PAS
FILEREAD.PAS(161,3) Note: Local variable "b" not used
FILEREAD.PAS(161,6) Note: Local variable "b2" not used
FILEREAD.PAS(163,3) Note: Local variable "code" not used
FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
FILEREAD.PAS(237,5) Note: Local variable "i" not used
FILEREAD.PAS(238,5) Note: Local variable "NyStr" not used
Compiling .\sebran\Delphi4\GENERELL.PAS
Compiling .\sebran\Delphi4\MESSAGE.PAS
MESSAGE.PAS(41,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(42,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(32,20) Hint: Unit "windows" not used in Message
MESSAGE.PAS(32,30) Hint: Unit "messages" not used in Message
Compiling resource .\sebran\Delphi4\MESSAGE.DFM
D:\lazarus\fpc\2.2.2\bin\i386-win32\windres.exe: can not determine type of file `.\sebran\Delphi4\MESSAGE.DFM'; use the -J option
D:\Temp\sebran\Delphi4\MESSAGE.PAS(76,1) Error: Error while linking
D:\Temp\sebran\Delphi4\MESSAGE.PAS(76,1) Fatal: There were 1 errors compiling module, stopping



Title: Re: convert Sebran delphi(4) code to lazarus
Post by: theo on February 13, 2009, 07:27:42 pm
http://wiki.lazarus.freepascal.org/Special:Search?search=dfm&go=Go
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 16, 2009, 10:03:43 am
Hi

I have replaced all dfm files by the lfm files in the package and then tried to compile it.

I get some errors. That is in the attachment.

and compiler deliver this messages.

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(434,42) Hint: Parameter "Color" not used
D:\Temp\MPlayer.pas(104,33) Hint: Parameter "YPos" not used
D:\Temp\MPlayer.pas(123,23) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(124,27) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(111,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(113,30) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(115,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(149,38) Hint: Parameter "Shift" not used
D:\Temp\MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
Compiling .\sebran\Delphi4\FILEREAD.PAS
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,3) Note: Local variable "b" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,6) Note: Local variable "b2" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(163,3) Note: Local variable "code" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
D:\Temp\sebran\Delphi4\FILEREAD.PAS(237,5) Note: Local variable "i" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(238,5) Note: Local variable "NyStr" not used
Compiling .\sebran\Delphi4\GENERELL.PAS
Compiling .\sebran\Delphi4\MESSAGE.PAS
MESSAGE.PAS(41,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(42,30) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,20) Hint: Unit "windows" not used in Message
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,30) Hint: Unit "messages" not used in Message
Compiling resource .\sebran\Delphi4\MESSAGE.DFM
windres: can not determine type of file `.\sebran\Delphi4\MESSAGE.DFM'; use the -J option
MESSAGE.PAS(76,1) Error: Error while linking
Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(434,42) Hint: Parameter "Color" not used
MPlayer.pas(104,33) Hint: Parameter "YPos" not used
MPlayer.pas(123,23) Hint: Parameter "Button" not used
MPlayer.pas(124,27) Hint: Parameter "Button" not used
MPlayer.pas(111,31) Hint: Parameter "Message" not used
MPlayer.pas(113,30) Hint: Parameter "Message" not used
MPlayer.pas(115,31) Hint: Parameter "Message" not used
MPlayer.pas(149,38) Hint: Parameter "Shift" not used
MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
Compiling .\sebran\Delphi4\FILEREAD.PAS
FILEREAD.PAS(161,3) Note: Local variable "b" not used
FILEREAD.PAS(161,6) Note: Local variable "b2" not used
FILEREAD.PAS(163,3) Note: Local variable "code" not used
FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
FILEREAD.PAS(237,5) Note: Local variable "i" not used
FILEREAD.PAS(238,5) Note: Local variable "NyStr" not used
Compiling .\sebran\Delphi4\GENERELL.PAS
Compiling .\sebran\Delphi4\MESSAGE.PAS
MESSAGE.PAS(41,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(42,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(32,20) Hint: Unit "windows" not used in Message
MESSAGE.PAS(32,30) Hint: Unit "messages" not used in Message
Compiling resource .\sebran\Delphi4\MESSAGE.DFM
D:\lazarus\fpc\2.2.2\bin\i386-win32\windres.exe: can not determine type of file `.\sebran\Delphi4\MESSAGE.DFM'; use the -J option
D:\Temp\sebran\Delphi4\MESSAGE.PAS(76,1) Error: Error while linking
D:\Temp\sebran\Delphi4\MESSAGE.PAS(76,1) Fatal: There were 1 errors compiling module, stopping
MESSAGE.PAS(-1,0) Error: TSourceChangeCache.ReplaceEx ToPos>MainScanner.CleanedLen+1


Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 16, 2009, 10:05:52 pm

do you have some idea, how can I solve this problem ?
could you help me please ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: arnoldb on February 17, 2009, 09:05:24 am
It looks like some kind of problem on the MESSAGE.DFM form not converted to Lazarus properly yet...

I'd suggest you look at that first.

Not much help - I know, but a starting place at least.

Regards

Arnold
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 17, 2009, 10:27:37 am

Hi

I gues that the name (Message) of this file could be the Problem.
and compiler access other routine .

because the compiler deliver this messages.

D:\lazarus\fpc\2.2.2\bin\i386-win32\windres.exe: can not determine type of file `.\sebran\Delphi4\MESSAGE.DFM'; use the -J option
D:\Temp\sebran\Delphi4\MESSAGE.PAS(76,1) Error: Error while linking

am I right ?
should I rename this file ?
what do you think ?



 
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 17, 2009, 10:38:23 am
I think you should read the conversion guide (http://wiki.lazarus.freepascal.org/Code_Conversion_Guide#Converting_Delphi_projects.2Fforms.2Funits_to_Lazarus) carefully. It is one of the links mentioned to you before: http://forum.lazarus.freepascal.org/index.php/topic,6252.msg29104.html#msg29104
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 17, 2009, 11:53:33 am


Hi

I have done things written in the code conversation guide.

I could come a another step forward.

but waht about this messages ?
I do not know what kind of Error that is.

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(434,42) Hint: Parameter "Color" not used
D:\Temp\MPlayer.pas(104,33) Hint: Parameter "YPos" not used
D:\Temp\MPlayer.pas(123,23) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(124,27) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(111,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(113,30) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(115,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(149,38) Hint: Parameter "Shift" not used
D:\Temp\MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
Compiling .\sebran\Delphi4\FILEREAD.PAS
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,3) Note: Local variable "b" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,6) Note: Local variable "b2" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(163,3) Note: Local variable "code" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
D:\Temp\sebran\Delphi4\FILEREAD.PAS(237,5) Note: Local variable "i" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(238,5) Note: Local variable "NyStr" not used
Compiling .\sebran\Delphi4\GENERELL.PAS
Compiling .\sebran\Delphi4\MESSAGE.PAS
MESSAGE.PAS(41,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(42,30) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,20) Hint: Unit "windows" not used in Message
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,30) Hint: Unit "messages" not used in Message
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\HURMAN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\HANGMAN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\REGN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\ABOUT.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
D:\Temp\sebran\Delphi4\HMENY.PAS(203,34) Warning: unreachable code
HMENY.PAS(89,24) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HMENY.PAS(262,20) Error: Identifier not found "frmOvMemory"
D:\Temp\sebran\Delphi4\HMENY.PAS(262,35) Error: Identifier not found "TfrmOvMemory"
D:\Temp\sebran\Delphi4\HMENY.PAS(263,19) Error: Identifier not found "frmOvMemory"
D:\Temp\sebran\Delphi4\HMENY.PAS(274,21) Error: Identifier not found "frmOvMemory"
D:\Temp\sebran\Delphi4\HMENY.PAS(274,36) Error: Identifier not found "TfrmOvMemory"
D:\Temp\sebran\Delphi4\HMENY.PAS(275,20) Error: Identifier not found "frmOvMemory"
D:\Temp\sebran\Delphi4\HMENY.PAS(591) Fatal: There were 6 errors compiling module, stopping




Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 17, 2009, 11:59:35 am
Can be a lot of things, for example:
You didn't include the unit in which TfrmOvMemory and frmOvMemory are declared in the uses clause of HMENY.PAS.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 17, 2009, 12:13:44 pm


Hi Vincent

first of all Tanx a lot for your help.

At the begining I had to change one file name Memory to Memoryy
because it has colidate with a unit of compiler with the same name.
could it be the problem ?
what could I do now ?
 
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 17, 2009, 12:33:40 pm
Find places where you previously used a unit called Memory. Make sure you use a unit called Memoryy now.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 17, 2009, 02:03:29 pm

I have change the filename from Memory to MMemory because the memoryy was used as a parameter.
and I think I came another step forward.
The compiler is standing at another place by the end of Font;
       { Draw the text }
       Canvas.Font.Name := Font;
what can I do now ?

and  compiler deliver the folowing message.


Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(434,42) Hint: Parameter "Color" not used
D:\Temp\MPlayer.pas(104,33) Hint: Parameter "YPos" not used
D:\Temp\MPlayer.pas(123,23) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(124,27) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(111,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(113,30) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(115,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(149,38) Hint: Parameter "Shift" not used
D:\Temp\MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
Compiling .\sebran\Delphi4\FILEREAD.PAS
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,3) Note: Local variable "b" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,6) Note: Local variable "b2" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(163,3) Note: Local variable "code" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
D:\Temp\sebran\Delphi4\FILEREAD.PAS(237,5) Note: Local variable "i" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(238,5) Note: Local variable "NyStr" not used
Compiling .\sebran\Delphi4\GENERELL.PAS
Compiling .\sebran\Delphi4\MESSAGE.PAS
MESSAGE.PAS(41,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(42,30) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,20) Hint: Unit "windows" not used in Message
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,30) Hint: Unit "messages" not used in Message
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\HURMAN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\MMEMORY.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\HANGMAN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\REGN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\ABOUT.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
D:\Temp\sebran\Delphi4\HMENY.PAS(206,34) Warning: unreachable code
HMENY.PAS(89,24) Hint: Parameter "Sender" not used
HMENY.PAS(90,29) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HMENY.PAS(90,46) Hint: Parameter "Button" not used
D:\Temp\sebran\Delphi4\HMENY.PAS(91,7) Hint: Parameter "Shift" not used
HMENY.PAS(92,26) Hint: Parameter "Sender" not used
HMENY.PAS(93,27) Hint: Parameter "Sender" not used
HMENY.PAS(94,28) Hint: Parameter "Sender" not used
HMENY.PAS(101,27) Hint: Parameter "Sender" not used
HMENY.PAS(112,27) Hint: Parameter "Sender" not used
HMENY.PAS(149,28) Hint: Parameter "Sender" not used
HMENY.PAS(150,30) Hint: Parameter "Sender" not used
HMENY.PAS(151,28) Hint: Parameter "Sender" not used
HMENY.PAS(152,29) Hint: Parameter "Sender" not used
HMENY.PAS(154,30) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HMENY.PAS(31,30) Hint: Unit "messages" not used in Hmeny
ABOUT.PAS(60,24) Hint: Parameter "Sender" not used
ABOUT.PAS(61,28) Hint: Parameter "Sender" not used
ABOUT.PAS(62,26) Hint: Parameter "Sender" not used
ABOUT.PAS(64,31) Hint: Parameter "Sender" not used
ABOUT.PAS(66,37) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\ABOUT.PAS(31,30) Hint: Unit "messages" not used in About
D:\Temp\sebran\Delphi4\ABOUT.PAS(79,11) Hint: Unit "Hmeny" not used in About
D:\Temp\sebran\Delphi4\REGN.PAS(117,4) Note: Local variable "X1" not used
D:\Temp\sebran\Delphi4\REGN.PAS(117,7) Note: Local variable "X2" not used
D:\Temp\sebran\Delphi4\REGN.PAS(117,10) Note: Local variable "Y1" not used
D:\Temp\sebran\Delphi4\REGN.PAS(117,13) Note: Local variable "Y2" not used
REGN.PAS(45,26) Hint: Parameter "Sender" not used
REGN.PAS(46,24) Hint: Parameter "Sender" not used
REGN.PAS(47,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\REGN.PAS(188,4) Note: Local variable "Rectt" not used
REGN.PAS(48,27) Hint: Parameter "Sender" not used
REGN.PAS(49,28) Hint: Parameter "Sender" not used
REGN.PAS(50,29) Hint: Parameter "Sender" not used
REGN.PAS(51,25) Hint: Parameter "Sender" not used
REGN.PAS(52,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\REGN.PAS(31,30) Hint: Unit "messages" not used in Regn
D:\Temp\sebran\Delphi4\REGN.PAS(32,46) Hint: Unit "Message" not used in Regn
D:\Temp\sebran\Delphi4\REGN.PAS(32,65) Hint: Unit "MPlayer" not used in Regn
D:\Temp\sebran\Delphi4\REGN.PAS(83,10) Hint: Unit "Hmeny" not used in Regn
HANGMAN.PAS(57,26) Hint: Parameter "Sender" not used
HANGMAN.PAS(58,24) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(200,6) Hint: Local const "Cols" is not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(201,6) Hint: Local const "Rows" is not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(203,4) Note: Local variable "i" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(203,6) Note: Local variable "j" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(204,4) Note: Local variable "X" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(204,6) Note: Local variable "Y" not used
HANGMAN.PAS(59,28) Hint: Parameter "Sender" not used
HANGMAN.PAS(60,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(262,6) Note: Local variable "j" not used
HANGMAN.PAS(61,33) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(61,50) Hint: Parameter "Button" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(62,7) Hint: Parameter "Shift" not used
HANGMAN.PAS(63,29) Hint: Parameter "Sender" not used
HANGMAN.PAS(64,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(32,20) Hint: Unit "windows" not used in Hangman
D:\Temp\sebran\Delphi4\HANGMAN.PAS(32,30) Hint: Unit "messages" not used in Hangman
D:\Temp\sebran\Delphi4\HANGMAN.PAS(33,56) Hint: Unit "Message" not used in Hangman
D:\Temp\sebran\Delphi4\HANGMAN.PAS(98,10) Hint: Unit "Hmeny" not used in Hangman
MMEMORY.PAS(57,26) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(154,4) Note: Local variable "DX" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(154,7) Note: Local variable "DY" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(263,23) Warning: Function result does not seem to be set
D:\Temp\sebran\Delphi4\MMEMORY.PAS(74,28) Hint: Parameter "X" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(74,30) Hint: Parameter "Y" not used
MMEMORY.PAS(58,24) Hint: Parameter "Sender" not used
MMEMORY.PAS(59,29) Hint: Parameter "Sender" not used
MMEMORY.PAS(60,31) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(60,48) Hint: Parameter "Button" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(61,7) Hint: Parameter "Shift" not used
MMEMORY.PAS(62,28) Hint: Parameter "Sender" not used
MMEMORY.PAS(64,30) Hint: Parameter "Sender" not used
MMEMORY.PAS(65,30) Hint: Parameter "Sender" not used
MMEMORY.PAS(66,30) Hint: Parameter "Sender" not used
MMEMORY.PAS(67,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(31,20) Hint: Unit "windows" not used in MMemory
D:\Temp\sebran\Delphi4\MMEMORY.PAS(31,30) Hint: Unit "messages" not used in MMemory
D:\Temp\sebran\Delphi4\MMEMORY.PAS(32,56) Hint: Unit "MPlayer" not used in MMemory
D:\Temp\sebran\Delphi4\MMEMORY.PAS(96,10) Hint: Unit "Hmeny" not used in MMemory
D:\Temp\sebran\Delphi4\HURMAN.PAS(209,50) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\sebran\Delphi4\HURMAN.PAS(186,4) Note: Local variable "r" not used
D:\Temp\sebran\Delphi4\HURMAN.PAS(186,6) Note: Local variable "g" not used
D:\Temp\sebran\Delphi4\HURMAN.PAS(186,8) Note: Local variable "b" not used
D:\Temp\sebran\Delphi4\HURMAN.PAS(381,4) Note: Local variable "i" not used
HURMAN.PAS(56,29) Hint: Parameter "Sender" not used
HURMAN.PAS(57,26) Hint: Parameter "Sender" not used
HURMAN.PAS(62,27) Hint: Parameter "Sender" not used
HURMAN.PAS(63,24) Hint: Parameter "Sender" not used
HURMAN.PAS(64,28) Hint: Parameter "Sender" not used
HURMAN.PAS(65,28) Hint: Parameter "Sender" not used
HURMAN.PAS(66,28) Hint: Parameter "Sender" not used
HURMAN.PAS(67,28) Hint: Parameter "Sender" not used
HURMAN.PAS(68,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HURMAN.PAS(33,20) Hint: Unit "windows" not used in Hurman
D:\Temp\sebran\Delphi4\HURMAN.PAS(33,30) Hint: Unit "messages" not used in Hurman
D:\Temp\sebran\Delphi4\HURMAN.PAS(34,74) Hint: Unit "MPlayer" not used in Hurman
D:\Temp\sebran\Delphi4\HURMAN.PAS(89,10) Hint: Unit "Hmeny" not used in Hurman
D:\Temp\sebran\Delphi4\GENERELL.PAS(189,28) Warning: Symbol "Handle" is deprecated
D:\Temp\sebran\Delphi4\GENERELL.PAS(191,18) Warning: Symbol "Handle" is deprecated
D:\Temp\sebran\Delphi4\GENERELL.PAS(184,4) Note: Local variable "wtext" not used
D:\Temp\sebran\Delphi4\GENERELL.PAS(235,32) Error: Incompatible type for arg no. 1: Got "TFont", expected "AnsiString"
Hint: Found declaration: TFont.SetName(AnsiString)
D:\Temp\sebran\Delphi4\GENERELL.PAS(243,42) Error: Incompatible type for arg no. 6: Got "TFont", expected "AnsiString"
D:\Temp\sebran\Delphi4\GENERELL.PAS(181,11) Hint: Found declaration: DrawChar(LongInt, LongInt, TImage, AnsiString, LongInt, AnsiString, LongInt)
D:\Temp\sebran\Delphi4\GENERELL.PAS(301,31) Hint: Local variable "strTempSingular" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(302,31) Hint: Local variable "strTempPlural" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(370,31) Hint: Local variable "strTemp" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(426,39) Hint: Local variable "strDummy" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(505) Fatal: There were 2 errors compiling module, stopping




Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 17, 2009, 03:41:16 pm
I have replaced the Font with AnsiString but it did not help.

The compiler deliver another Error message

D:\Temp\sebran\Delphi4\GENERELL.PAS(241,38) Error: type identifier not allowed here
D:\Temp\sebran\Delphi4\GENERELL.PAS(249,48) Error: type identifier not allowed here
D:\Temp\sebran\Delphi4\GENERELL.PAS(307,31) Hint: Local variable "strTempSingular" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(308,31) Hint: Local variable "strTempPlural" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(376,31) Hint: Local variable "strTemp" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(432,39) Hint: Local variable "strDummy" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(511) Fatal: There were 2 errors compiling module, stopping
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 17, 2009, 03:50:45 pm
Sometimes, I wonder if you know what you are doing ...

No idea why it works in Delphi though.

Where is that font variable declared?

try
Code: [Select]
Canvas.Font := Font;

Maybe that compiles (and changes functionality at the same time).
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 17, 2009, 04:05:03 pm


Font is declaired in
Procedure DrawButton(Im: TImage; Text: String; Col: Longint; Font: String; FSize: Integer; PCent: Integer; BStyle: Integer);

that is very smal routine for drwing charakter

and now the compiler is standing at the end of Font by this line
with the same error message like before.

DrawChar(X, Y, Im, Text, Col, Font, FSize);
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 17, 2009, 04:51:42 pm


I had a another look and I have seen four procedures
have declaired Font as String
how could it imported to lazarus ?

Procedure DrawCharCenter(X,Y: Longint; Im: TImage; Text: String; Col: Longint; Font: String; FSize: Integer);
Procedure DrawChar(X,Y: Longint;  Im: TImage; Text: String; Col: Longint; Font: String; FSize: Integer);
Procedure DrawButton(Im: TImage; Text: String; Col: Longint; Font: String; FSize: Integer; PCent: Integer; BStyle: Integer);
Function FontSize(Pixels: Integer; Font: String; Canv: TCanvas): integer;
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: theo on February 17, 2009, 06:20:28 pm
http://wiki.lazarus.freepascal.org/Bounties

;-)
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 17, 2009, 07:06:35 pm
:D
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 17, 2009, 08:05:42 pm


I just want to modify sebran for my little son using lazarus.
and thought you were also intersted to find out the bugs of lazarus.
I still needs help for workaround .
please help me.

Title: Re: convert Sebran delphi(4) code to lazarus
Post by: theo on February 17, 2009, 08:59:29 pm
Why do you want to port it to Lazarus anyway?

Porting complete Delphi applications with Graphics, Mediaplayer, Databases to Lazarus is not a begginers task.
You need experience from both worlds (Delphi and Lazarus) to do that.

Why not compile it with Delphi?
There are even free versions afaik: http://www.turboexplorer.com/delphi
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 18, 2009, 01:48:31 pm

tanx a lot for the link,
certainly I will try it with turbodelphi too. But as long as I get help I will go on with porting sebran to lazarus too.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 19, 2009, 02:36:38 pm


I have tried to chand the Variable Font but the compiler does not like it. I have raplaced the name Font in FontN in Procedures and calls and else wehre it was definde as variable but the compiler delivers only few lines and stops very quickly.
like this   DrawChar(X, Y, Im, Text, Col, FontN, FSize);
It seems copmliler of lazarus want see there a Variable String ,
but Font is not recognized as a variable string but as TFont.
Is that normal ?

Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
package01.pas(11,9) Hint: Unit "Consts" not used in package01
package01.pas(11,18) Hint: Unit "MPlayer" not used in package01
package01.pas(11,28) Hint: Unit "Fileread" not used in package01
package01.pas(11,45) Hint: Unit "Hmeny" not used in package01
package01.pas(11,52) Hint: Unit "About" not used in package01
package01.pas(11,75) Hint: Unit "Regn" not used in package01
package01.pas(12,10) Hint: Unit "Message" not used in package01
22 lines compiled, 0.5 sec
9 hint(s) issued
"Compiling package package01 0.0" beendet
 
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 20, 2009, 05:17:38 am
Quote
have raplaced the name Font in FontN in Procedures and calls and else wehre it was definde as variable but the compiler delivers only few lines and stops very quickly.
If the compiler messages you post is that "few lines" you mentioned, then the package is compiled. Your porting is done.
Quote
It seems copmliler of lazarus want see there a Variable String ,
but Font is not recognized as a variable string but as TFont.
Is that normal ?
Assuming the class has Font property, it depends on the compiler switch. Delphi allows method parameters to have the same name with class properties, but ObjFPC doesn't. This is to avoid ambiguity in usage, whether to access the parameter or the property. I think in this case Delphi choose the parameter.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 20, 2009, 12:25:13 pm

Tanx for your reply.
2 things
1. It does not run.
2. compiler deliver the same messages if I replace only one of this Font to FontN. not all of them.
only in this line
DrawChar(X, Y, Im, Text, Col, FontN, FSize);
There should be certainly a another possibility to define Font as a variable string.
do you know that ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 20, 2009, 01:42:14 pm
Quote
It does not run.
You've ported a package, not an application. Of course it won't run! You need to build an application on top of it.
Quote
Sometimes, I wonder if you know what you are doing ...
I agree with Vincent more than before now...
Quote
compiler deliver the same messages if I replace only one of this Font to FontN. not all of them.
only in this line
DrawChar(X, Y, Im, Text, Col, FontN, FSize);
I need to see the whole procedure where this FontN is declared, changing all won't solve the problem as one occurence may point to the String one while others to the TFont.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 23, 2009, 10:52:11 am





That is the whole procedure



Procedure DrawButton(Im: TImage; Text: String; Col: Longint; Font: String; FSize: Integer; PCent: Integer; BStyle: Integer);
{ Fills the image with a rounded rectangle border, and a centered text}
var
   X, Y: Integer;
begin
  {Draw a rounded rectangle }
  {If (Font = TYPEFACE) and (FSize < 15) then Font := 'Arial';   }
  With Im do begin
       Canvas.Brush.Color := (02 shl 24) or clBlack;
       Canvas.Brush.Style := bsSolid;
       Canvas.Pen.Width := 2 * (Screen.Height div 480);
       Canvas.FillRect(Rect(0, 0, Width, Height)) ;

       Canvas.Brush.Style := bsClear;
       Case BStyle of
          THICKBORDER: begin
              Canvas.Pen.Width := 2 * (Screen.Height div 480) + 1;
              Canvas.Pen.Color := (02 shl 24) or clGray;
              Canvas.RoundRect( 2, 2, Width - 3, Height - 3,
                      Trunc(Width * (PCent / 100)) , Trunc(Width * (PCent / 100)) ) ;
              Canvas.Pen.Width := 2 * (Screen.Height div 480);
              Canvas.Pen.Color := (02 shl 24) or clWhite;
              Canvas.RoundRect( 2, 2, Width - 3, Height - 3,
                  Trunc(Width * (PCent / 100)) , Trunc(Width * (PCent / 100)) ) ;
          end;
          THINBORDER: begin
              Canvas.Pen.Width := 1;
              Canvas.Pen.Color := clGray;
              Canvas.RoundRect( 2, 2, Width - 3, Height - 3,
                  Trunc(Width * (PCent / 100)) , Trunc(Width * (PCent / 100)) ) ;
          end;
       end;
       { Draw the text }
       Canvas.Font.Name := 'Arial';
       Canvas.Font.Size := FSize;
       Im.Canvas.Font.Style := [];
       {If Font = TYPEFACE then
          Y := Trunc((Height - Canvas.TextHeight('x') * 1.2)) div 2
       else   }
          Y := Trunc((Height - Canvas.TextHeight(Text) )) div 2;
       X := (Width - Canvas.TextWidth(Text)) div 2;
       DrawChar(X, Y, Im, Text, Col, FontN, FSize);
  end;
end;                   
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 23, 2009, 11:18:53 am
I don't see any FontN declared. Question: What does DrawChar expect? Just post the method header if you don't know.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 23, 2009, 01:54:40 pm


that is the procedure draw char and I send you additional the wohle
file Generell.pas in this file are all this procedure defined.



Procedure DrawChar(X,Y: Longint;  Im: TImage; Text: String; Col: Longint; Font: String; FSize: Integer);
var
   logFont: TLogFont;
   wtext: Widestring;

begin
  { Draw the character }

  GetObject(Im.Canvas.Font.Handle, SizeOf(LogFont), Addr(LogFont));
  logFont.lfQuality:=ANTIALIASED_QUALITY;
  Im.Canvas.Font.Handle:=CreateFontIndirect(logFont);
  Im.Canvas.Font.Size := FSize;
  Im.Canvas.Font.Name := Font;
  Im.Canvas.Font.Style := [];
  Im.Canvas.Brush.Style := bsClear;
  Im.Canvas.Font.Color := (02 shl 24) or Col;
  Im.Canvas.TextOut(X,Y, text);

end; 
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 24, 2009, 02:47:42 am
OK, just change:
Code: [Select]
Procedure DrawButton(Im: TImage; Text: String; Col: Longint; [b]Font[/b]: String; FSize: Integer; PCent: Integer; BStyle: Integer);to something like:
Quote
Procedure DrawButton(Im: TImage; Text: String; Col: Longint; FontN: String; FSize: Integer; PCent: Integer; BStyle: Integer);
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 24, 2009, 10:39:59 am

Hi

with this error at the same line at
DrawChar(X, Y, Im, Text, Col, FontN, FSize);

D:\Temp\sebran\Delphi4\GENERELL.PAS(193,30) Error: Identifier not found "Font"
D:\Temp\sebran\Delphi4\GENERELL.PAS(242,43) Error: Identifier not found "FontN"





Hint: Start of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Hint: End of reading config file D:\lazarus\fpc\2.2.2\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.2.2 [2008/10/05] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Win32 for i386
Compiling package01.pas
Compiling D:\delphi\consts.pas
Writing Resource String Table file: consts.rst
Compiling MPlayer.pas
D:\Temp\MPlayer.pas(101,15) Warning: An inherited method is hidden by "TMediaPlayer.SetVisible(TButtonSet)"
D:\Temp\MPlayer.pas(283,52) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(434,42) Hint: Parameter "Color" not used
D:\Temp\MPlayer.pas(104,33) Hint: Parameter "YPos" not used
D:\Temp\MPlayer.pas(123,23) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(124,27) Hint: Parameter "Button" not used
D:\Temp\MPlayer.pas(111,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(113,30) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(115,31) Hint: Parameter "Message" not used
D:\Temp\MPlayer.pas(149,38) Hint: Parameter "Shift" not used
D:\Temp\MPlayer.pas(859,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(909,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(954,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(989,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1011,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1041,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1061,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1121,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1179,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1207,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1251,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1278,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1299,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1325,57) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1335,47) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1346,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1357,49) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1384,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1428,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1442,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1476,61) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1498,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1512,60) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1529,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1534,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1539,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1544,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1549,53) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1558,58) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1571,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1582,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1593,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1603,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1613,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1624,59) Hint: Conversion between ordinals and pointers is not portable
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\Temp\MPlayer.pas(1705,36) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(1706,18) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\MPlayer.pas(242,3) Hint: Local const "mci_Back" is not used
Compiling .\sebran\Delphi4\FILEREAD.PAS
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,3) Note: Local variable "b" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(161,6) Note: Local variable "b2" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(163,3) Note: Local variable "code" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(226,52) Hint: Local variable "TempBufSize" does not seem to be initialized
D:\Temp\sebran\Delphi4\FILEREAD.PAS(237,5) Note: Local variable "i" not used
D:\Temp\sebran\Delphi4\FILEREAD.PAS(238,5) Note: Local variable "NyStr" not used
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\HURMAN.PAS
Compiling .\sebran\Delphi4\GENERELL.PAS
Compiling .\sebran\Delphi4\MESSAGE.PAS
MESSAGE.PAS(41,30) Hint: Parameter "Sender" not used
MESSAGE.PAS(42,30) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,20) Hint: Unit "windows" not used in Message
D:\Temp\sebran\Delphi4\MESSAGE.PAS(32,30) Hint: Unit "messages" not used in Message
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\HURMAN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\MMEMORY.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\HANGMAN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\REGN.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
Compiling .\sebran\Delphi4\ABOUT.PAS
Compiling .\sebran\Delphi4\HMENY.PAS
D:\Temp\sebran\Delphi4\HMENY.PAS(206,34) Warning: unreachable code
HMENY.PAS(89,24) Hint: Parameter "Sender" not used
HMENY.PAS(90,29) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HMENY.PAS(90,46) Hint: Parameter "Button" not used
D:\Temp\sebran\Delphi4\HMENY.PAS(91,7) Hint: Parameter "Shift" not used
HMENY.PAS(92,26) Hint: Parameter "Sender" not used
HMENY.PAS(93,27) Hint: Parameter "Sender" not used
HMENY.PAS(94,28) Hint: Parameter "Sender" not used
HMENY.PAS(101,27) Hint: Parameter "Sender" not used
HMENY.PAS(112,27) Hint: Parameter "Sender" not used
HMENY.PAS(149,28) Hint: Parameter "Sender" not used
HMENY.PAS(150,30) Hint: Parameter "Sender" not used
HMENY.PAS(151,28) Hint: Parameter "Sender" not used
HMENY.PAS(152,29) Hint: Parameter "Sender" not used
HMENY.PAS(154,30) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HMENY.PAS(31,30) Hint: Unit "messages" not used in Hmeny
ABOUT.PAS(60,24) Hint: Parameter "Sender" not used
ABOUT.PAS(61,28) Hint: Parameter "Sender" not used
ABOUT.PAS(62,26) Hint: Parameter "Sender" not used
ABOUT.PAS(64,31) Hint: Parameter "Sender" not used
ABOUT.PAS(66,37) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\ABOUT.PAS(31,30) Hint: Unit "messages" not used in About
D:\Temp\sebran\Delphi4\ABOUT.PAS(79,11) Hint: Unit "Hmeny" not used in About
D:\Temp\sebran\Delphi4\REGN.PAS(117,4) Note: Local variable "X1" not used
D:\Temp\sebran\Delphi4\REGN.PAS(117,7) Note: Local variable "X2" not used
D:\Temp\sebran\Delphi4\REGN.PAS(117,10) Note: Local variable "Y1" not used
D:\Temp\sebran\Delphi4\REGN.PAS(117,13) Note: Local variable "Y2" not used
REGN.PAS(45,26) Hint: Parameter "Sender" not used
REGN.PAS(46,24) Hint: Parameter "Sender" not used
REGN.PAS(47,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\REGN.PAS(188,4) Note: Local variable "Rectt" not used
REGN.PAS(48,27) Hint: Parameter "Sender" not used
REGN.PAS(49,28) Hint: Parameter "Sender" not used
REGN.PAS(50,29) Hint: Parameter "Sender" not used
REGN.PAS(51,25) Hint: Parameter "Sender" not used
REGN.PAS(52,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\REGN.PAS(31,30) Hint: Unit "messages" not used in Regn
D:\Temp\sebran\Delphi4\REGN.PAS(32,46) Hint: Unit "Message" not used in Regn
D:\Temp\sebran\Delphi4\REGN.PAS(32,65) Hint: Unit "MPlayer" not used in Regn
D:\Temp\sebran\Delphi4\REGN.PAS(83,10) Hint: Unit "Hmeny" not used in Regn
HANGMAN.PAS(57,26) Hint: Parameter "Sender" not used
HANGMAN.PAS(58,24) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(200,6) Hint: Local const "Cols" is not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(201,6) Hint: Local const "Rows" is not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(203,4) Note: Local variable "i" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(203,6) Note: Local variable "j" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(204,4) Note: Local variable "X" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(204,6) Note: Local variable "Y" not used
HANGMAN.PAS(59,28) Hint: Parameter "Sender" not used
HANGMAN.PAS(60,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(262,6) Note: Local variable "j" not used
HANGMAN.PAS(61,33) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(61,50) Hint: Parameter "Button" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(62,7) Hint: Parameter "Shift" not used
HANGMAN.PAS(63,29) Hint: Parameter "Sender" not used
HANGMAN.PAS(64,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HANGMAN.PAS(32,20) Hint: Unit "windows" not used in Hangman
D:\Temp\sebran\Delphi4\HANGMAN.PAS(32,30) Hint: Unit "messages" not used in Hangman
D:\Temp\sebran\Delphi4\HANGMAN.PAS(33,56) Hint: Unit "Message" not used in Hangman
D:\Temp\sebran\Delphi4\HANGMAN.PAS(98,10) Hint: Unit "Hmeny" not used in Hangman
MMEMORY.PAS(57,26) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(154,4) Note: Local variable "DX" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(154,7) Note: Local variable "DY" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(263,23) Warning: Function result does not seem to be set
D:\Temp\sebran\Delphi4\MMEMORY.PAS(74,28) Hint: Parameter "X" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(74,30) Hint: Parameter "Y" not used
MMEMORY.PAS(58,24) Hint: Parameter "Sender" not used
MMEMORY.PAS(59,29) Hint: Parameter "Sender" not used
MMEMORY.PAS(60,31) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(60,48) Hint: Parameter "Button" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(61,7) Hint: Parameter "Shift" not used
MMEMORY.PAS(62,28) Hint: Parameter "Sender" not used
MMEMORY.PAS(64,30) Hint: Parameter "Sender" not used
MMEMORY.PAS(65,30) Hint: Parameter "Sender" not used
MMEMORY.PAS(66,30) Hint: Parameter "Sender" not used
MMEMORY.PAS(67,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\MMEMORY.PAS(31,20) Hint: Unit "windows" not used in MMemory
D:\Temp\sebran\Delphi4\MMEMORY.PAS(31,30) Hint: Unit "messages" not used in MMemory
D:\Temp\sebran\Delphi4\MMEMORY.PAS(32,56) Hint: Unit "MPlayer" not used in MMemory
D:\Temp\sebran\Delphi4\MMEMORY.PAS(96,10) Hint: Unit "Hmeny" not used in MMemory
D:\Temp\sebran\Delphi4\HURMAN.PAS(209,50) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\Temp\sebran\Delphi4\HURMAN.PAS(186,4) Note: Local variable "r" not used
D:\Temp\sebran\Delphi4\HURMAN.PAS(186,6) Note: Local variable "g" not used
D:\Temp\sebran\Delphi4\HURMAN.PAS(186,8) Note: Local variable "b" not used
D:\Temp\sebran\Delphi4\HURMAN.PAS(381,4) Note: Local variable "i" not used
HURMAN.PAS(56,29) Hint: Parameter "Sender" not used
HURMAN.PAS(57,26) Hint: Parameter "Sender" not used
HURMAN.PAS(62,27) Hint: Parameter "Sender" not used
HURMAN.PAS(63,24) Hint: Parameter "Sender" not used
HURMAN.PAS(64,28) Hint: Parameter "Sender" not used
HURMAN.PAS(65,28) Hint: Parameter "Sender" not used
HURMAN.PAS(66,28) Hint: Parameter "Sender" not used
HURMAN.PAS(67,28) Hint: Parameter "Sender" not used
HURMAN.PAS(68,28) Hint: Parameter "Sender" not used
D:\Temp\sebran\Delphi4\HURMAN.PAS(33,20) Hint: Unit "windows" not used in Hurman
D:\Temp\sebran\Delphi4\HURMAN.PAS(33,30) Hint: Unit "messages" not used in Hurman
D:\Temp\sebran\Delphi4\HURMAN.PAS(34,74) Hint: Unit "MPlayer" not used in Hurman
D:\Temp\sebran\Delphi4\HURMAN.PAS(89,10) Hint: Unit "Hmeny" not used in Hurman
D:\Temp\sebran\Delphi4\GENERELL.PAS(189,28) Warning: Symbol "Handle" is deprecated
D:\Temp\sebran\Delphi4\GENERELL.PAS(191,18) Warning: Symbol "Handle" is deprecated
D:\Temp\sebran\Delphi4\GENERELL.PAS(193,30) Error: Identifier not found "Font"
D:\Temp\sebran\Delphi4\GENERELL.PAS(242,43) Error: Identifier not found "FontN"
D:\Temp\sebran\Delphi4\GENERELL.PAS(300,31) Hint: Local variable "strTempSingular" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(301,31) Hint: Local variable "strTempPlural" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(369,31) Hint: Local variable "strTemp" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(425,39) Hint: Local variable "strDummy" does not seem to be initialized
D:\Temp\sebran\Delphi4\GENERELL.PAS(504) Fatal: There were 2 errors compiling module, stopping
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on February 25, 2009, 05:02:01 am
Send me your source code in zip format (either put it somewhere or use my email), I'll try converting it myself.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 26, 2009, 09:35:54 am
I have sent you a message.
please look to your box.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 26, 2009, 10:45:40 am


I attache now 4 zip files with my source code of sebran

you can find the originaly source code at
http://www.wartoft.nu/software/sebran/sebran_139_source.zip
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 26, 2009, 10:47:20 am
here the other two zip files
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Vincent Snijders on February 26, 2009, 11:15:28 am
here the other two zip files
I removed one of them, because it contained mplayer.pas with the following text:
Code: [Select]
Copyright (c) 1995,98 Inprise CorporationIt was not clear that the copyright allows to post the file on web forums, actually I don't think you are allowed to do that.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 26, 2009, 11:45:02 am


OK. I sned you a zip file without Mplayer.pas and consts.pas that I have found it in internet.
Can I give the url-link to these files ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on February 28, 2009, 09:25:03 pm
I have send you directly an E-mail.
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on March 09, 2009, 04:14:42 pm

Is there any workaround for this message ?

Read Error
Stream=TfrmHuvudmeny:Root=:TfrmHuvudmeny
Component Class:Tshape
Error reading shp0v11.Pen.Cosmetic: unknown property."Cosmetic"
Stream position:4096
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on March 10, 2009, 05:39:36 am
Quote
Is there any workaround for this message ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on March 10, 2009, 10:51:45 am


I have converted dfm to lfm , and at promt I have removed missing property. I have made also trivial changes and saved project and packeges and compiled it again.
It shows me now new messeges.
/
Read error
Stream=TfrmHuvudmeny:Root=:TfrmHuvudmeny
Class "TMediaPlayer" not found
stream position 14978
/
Read error
in file D:\Temp\sebran\Delphi4\HMENY.lfm
Class "TMediaPlayer" not found
/
did I some mistake ?
What should I do now ?
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: Leledumbo on March 10, 2009, 11:36:49 am
Same thing plus some notes: AFAIK all things in form definition must be installed in the IDE. Therefore, if the TMediaPlayer is not installed, you can't use it like other components (in other words, you need to create it at runtime).
Title: Re: convert Sebran delphi(4) code to lazarus
Post by: von_ks on April 07, 2009, 09:29:20 am


If somebody would like to try porting by himself/herself
please write to me. so I will send all files I have.
TinyPortal © 2005-2018