>> I'm porting a delphi app to lazarus. But when I try to run the app
>> it keeps crashing with the below message.
>>
>> I suspect the LRS file is corrupt, but I have no idea how to check
>> or better fix this. I tried removing the LRS file several times
>> and save the project which recreates the LRS file. But that does
>> not help unfortunately. Does anyone have an idea? I'm using
>> lazarus 0.9.20 and fpc 2.0.4.
>
> The .lrs file is simply a converted .lfm file. I doubt it is
> 'corrupt', but it can contain properties/values that does not
> exist/make sense. see below
>
>
>> Darius
>>
>>
>> [InitComponent] TMainForm True
>> [InitComponent] TForm True
>> [InitComponent] CompResource found for TMainForm
>> Form Stream "TMainForm" Signature=TPF0
>> Form streaming "TMainForm" error: Class " " not found
>
> 'Class " " not found' is a TReader error.
> TReader seldom gives helpful error messages.
> Can you open the form in the IDE?
Yes, I can. The converted form containted indeed several invalid
properties like OldCreateOrder, but this is well known and I never
had problems with it before.
It's strange though that if I save the project after compiling the
form is not able to open anymore. I get the following error: "unable
to convert text form data of file c:\etc\etc\main.lfm into binary
stream. (Identifier expected on line 3191)".
Then the .lfm is corrupt. What is at (in front of) line 3191?
This is indeed the case. There is an empty "object end" on that line. When I
remove it the problem is still not solved. I get the error: "Unable to
transform binary component stream of Mainform: TMainForm into text.
Division by zero."
What I find strange is that after converting the dfm to lfm I need to remove
several invalid properties from the LFM (automatically proposed). Then I can
open the LFM file without problems in the IDE. But when I save the LFM file
it's corrupt and a lot of components on the form are gone.
I tried saving the form as XML file and it appears that the error starts
with the ImageList. Somehow saving the imagelist seems to have a bug. When I
check the imagelist from the IDE I seen nothing strange. Next is the
definition of the imagelist where the error occurs.
<component name="ImageList" class="TImageList">
<properties>
<integer name="left" value="40"/>
<integer name="top" value="480"/>
<binary name="Bitmap" value="li! (*from here some binary
characters are present*)
Darius
Mattias
>
>> [FORMS.PP] ExceptionOccurred
>> Sender=EAccessViolation
>> Exception=Access violation
>> Stack trace:
>> $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of
>> ./include/customaction.inc
>> $0040E189 TMAINFORM__SETMODE, line 856 of main.pas
>> $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas
>> $00404DB9 TCUSTOMFORM__DOCREATE, line 614
>> of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line
>> 1297 of ./include/customform.inc $0040C0D2
>> TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc
>> $004010AB main, line 32 of LpSolveIDE.lpr
>> TApplication.HandleException Access violation
>> Stack trace:
>> $00453A59 TCUSTOMACTION__SETCHECKED, line 102 of
>> ./include/customaction.inc
>> $0040E189 TMAINFORM__SETMODE, line 856 of main.pas
>> $00412F2A TMAINFORM__FORMCREATE, line 1955 of main.pas
>> $00404DB9 TCUSTOMFORM__DOCREATE, line 614
>> of ./include/customform.inc $0040656C TCUSTOMFORM__CREATE, line
>> 1297 of ./include/customform.inc $0040C0D2
>> TAPPLICATION__CREATEFORM, line 1523 of ./include/application.inc
>> $004010AB main, line 32 of LpSolveIDE.lpr
>> [InitComponent] TPromptDialog True
>> [InitComponent] TForm True
>> Runtime error 217 at $0055FA22
>> $0055FA22 DOUNHANDLEDEXCEPTION, line 156 of
>> C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc
>> $0055B80C fpc_reraise, line 266 of
>> C:/lazarus/source/fpcbuild/2.0.4/fpcsrc/rtl/inc/except.inc
>> $00401134 main, line 26 of LpSolveIDE.lpr
>> $0055B59E EXE_ENTRY, line 420 of system.pp
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives