Recent

Author Topic: Abstract method called when trying to save a new Form  (Read 2262 times)

denerdener

  • New Member
  • *
  • Posts: 13
Abstract method called when trying to save a new Form
« on: April 19, 2023, 02:21:50 pm »
Hi,

I'm trying to create a new Form on a new Project and when i try to save this form i have the follow warning:
"Incapaz  de obter fluxo Form1:TForm1 Abstract method called". (my Lazarus is in portuguese)
I downloaded the last version of lazarus IDE for windows (x32) Version: 2.2.6 Date: 2023-03-04 FPC Version: 3.2.2.

I tryed to rename to a new name the form, but i still have the same issue.

Can someone help me?

Thanks.

wp

  • Hero Member
  • *****
  • Posts: 13574
Re: Abstract method called when trying to save a new Form
« Reply #1 on: April 19, 2023, 05:16:03 pm »
I've never seen such an issue. Just to make sure that we are doing the same:

- I open Lazarus 2.2.6/FPC 3.2.2 (32-bit version) on Windows.
- Lazarus automatically creates an empty project with a form.
- Although there is already a form, I create an additional new form (that's what you are saying).
- Then I go to "File" > "Save as". The IDE first queries the name of the project - I enter an name for it; is gets the extension lpi. Then it asks for the name of the main unit (the unit for the form that had been created automatically) - I enter the name for it; it gets the extension pas. And finally it asks for the name of the additonally created unit - I enter its name.
- All ok, no error message.

Does the IDE tell you which abstract method has been called?

Not as a solution, but to get further information you could log the output of the IDE in a log file: Run Lazarus with the parameter "--debug-log=c:\laz-debuglog.txt" (no quotes, and replace "c:\laz-debuglog.txt" if you want another file name); this writes several messages to the specified log file which you can inspect in a text editor or upload here.

denerdener

  • New Member
  • *
  • Posts: 13
Re: Abstract method called when trying to save a new Form
« Reply #2 on: April 19, 2023, 06:46:45 pm »
Hi,
Yes, i does exactly what you say:

- I open Lazarus 2.2.6/FPC 3.2.2 (32-bit version) on Windows.
- Lazarus automatically creates an empty project with a form.

but here, whatever if i create a new form or using only the form that project creates automatic, the error will happen with all forms
  -> Although there is already a form, I create an additional new form (that's what you are saying).

and here, after i enter an name for the project, and after i enter a name for the form, i have that error
"Incapaz  de obter fluxo Form1:TForm1 Abstract method called" and create all the project files and only the .pas for form, do not create a .lfm file.
  -> Then I go to "File" > "Save as". The IDE first queries the name of the project - I enter an name for it; is gets the extension lpi. Then it asks for the name of the main unit (the unit for the form that had been created automatically) - I enter the name for it; it gets the extension pas. And finally it asks for the name of the additonally created unit - I enter its name.

I will try what you say, run with the parameter, but sorry, i dont know how to do this, is an option inside de IDE, or i need run something using prompt command?

error01 -> the image of error after i enter the form name and click in OK, the lazarus have a freeze for 2-5 seconds e show me the error.
error02 -> the image of my project folder after i try to save te project.

sorry for my bad english.

thanks.

Josh

  • Hero Member
  • *****
  • Posts: 1458
Re: Abstract method called when trying to save a new Form
« Reply #3 on: April 19, 2023, 07:01:59 pm »
Just to elimate AV Program.

Can you exclude the following folders from yur AntiVirus Scanner
1) Folder where you save you Projects
2) Lazarus Folder
3) FPC Folder
4) The Tmp folder used by Lazarus, in case you have altered the default.

AV programs can have really odd effects when developing software, especially the real time scanning and cloud up load scanning..
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

denerdener

  • New Member
  • *
  • Posts: 13
Re: Abstract method called when trying to save a new Form
« Reply #4 on: April 19, 2023, 07:43:04 pm »
i did this, i exclude from antivirus and gave all the permission in folders used

wp

  • Hero Member
  • *****
  • Posts: 13574
Re: Abstract method called when trying to save a new Form
« Reply #5 on: April 19, 2023, 07:47:06 pm »
i dont know how to do this
In the Explorer, go into the top-level folder of your Lazarus installation, the one which contains lazarus.exe. Right-click on an empty part in the right Explorer panel and select "Open a cmd window here" (or similar, I don't have an English Windows version) (or if this command is not available, open a cmd window, and cd (change dir) into the directory with lazarus.exe). Then type

Code: [Select]
lazarus --debug-log=c:\laz-debuglog.txt
This opens Lazarus and writes all debug message into the specified file. Do all you need to create the error. Then close Lazarus and inspect the log file.

Josh

  • Hero Member
  • *****
  • Posts: 1458
Re: Abstract method called when trying to save a new Form
« Reply #6 on: April 19, 2023, 07:48:21 pm »
You say you renamed the form etc, what name did you give it?
you may have given it a name that is a reserved pascal word.

make sure that your projects file names does not contain any spaces,
make sure the folder your saving to does not have any spaces in
ie
a folder called My Projects, will give you problems.

This also applies to the Lazarus & FPC Folders
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

denerdener

  • New Member
  • *
  • Posts: 13
Re: Abstract method called when trying to save a new Form
« Reply #7 on: April 19, 2023, 08:09:44 pm »
Hi,

This opens Lazarus and writes all debug message into the specified file. Do all you need to create the error. Then close Lazarus and inspect the log file.

i do this and this is the log after i open a project and try to save.

Quote
TLResourceList.Sort 64 DUPLICATE RESOURCE FOUND: TACBrNFe:PNG
TLResourceList.Sort 65 DUPLICATE RESOURCE FOUND: TACBrNFe:PNG
TLResourceList.Sort 73 DUPLICATE RESOURCE FOUND: TACBrNFSe:PNG
TLResourceList.Sort 101 DUPLICATE RESOURCE FOUND: TACBrSEF2:PNG
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="C:\Users\Usuario\AppData\Local\lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="C:\lazarus"
TLResourceList.Sort 64 DUPLICATE RESOURCE FOUND: TACBrNFe:PNG
TLResourceList.Sort 65 DUPLICATE RESOURCE FOUND: TACBrNFe:PNG
TLResourceList.Sort 73 DUPLICATE RESOURCE FOUND: TACBrNFSe:PNG
TLResourceList.Sort 101 DUPLICATE RESOURCE FOUND: TACBrSEF2:PNG
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32 New=i386-win32-win32 Changed: OS/CPU=True LCL=False
----------------
Hint: (lazarus) RenameUnit unit1.pas NewUnitName=Unit1 OldUnitName=Unit1 LFMCode=False LRSCode=False NewFilename="C:\LazarusProjetos\testeProjeto\unit1.pas"
  Stack trace:
  $004A31CD
  $009E9D40  SAVEEDITORFILE,  line 2592 of sourcefilemanager.pas
  $009EE218  SAVEPROJECT,  line 4005 of sourcefilemanager.pas
  $00461205  TMAINIDE__DOSAVEPROJECT,  line 6343 of main.pp
  $0045F601  TMAINIDE__DOSAVEALL,  line 5724 of main.pp
  $00457E70  TMAINIDE__MNUSAVEALLCLICKED,  line 3313 of main.pp
  $00771459  TIDESPECIALCOMMAND__DOONCLICK,  line 1640 of idecommands.pas
  $0077147A  TIDESPECIALCOMMAND__DOONCLICK,  line 1645 of idecommands.pas
  $00786C59  TIDETOOLBUTTON__CLICK,  line 646 of toolbarintf.pas
  $005BABEA  TTOOLBUTTON__MOUSEUP,  line 176 of ./include/toolbutton.inc
  $00577158  TCONTROL__DOMOUSEUP,  line 2347 of ./include/control.inc
  $00577E48  TCONTROL__WMLBUTTONUP,  line 2829 of ./include/control.inc
  $004108F1
  $00575C96  TCONTROL__PERFORM,  line 1617 of ./include/control.inc
  $0056B27E  TWINCONTROL__ISCONTROLMOUSEMSG,  line 4777 of ./include/wincontrol.inc
  $0056C573  TWINCONTROL__WNDPROC,  line 5398 of ./include/wincontrol.inc
  $006373E0  DELIVERMESSAGE,  line 112 of lclmessageglue.pas

i'm lost here, any idea?

thanks.

denerdener

  • New Member
  • *
  • Posts: 13
Re: Abstract method called when trying to save a new Form
« Reply #8 on: April 19, 2023, 08:11:48 pm »
Hi,

You say you renamed the form etc, what name did you give it?
you may have given it a name that is a reserved pascal word.

make sure that your projects file names does not contain any spaces,
make sure the folder your saving to does not have any spaces in
ie
a folder called My Projects, will give you problems.

This also applies to the Lazarus & FPC Folders

The folder when i have my projects are "C:\LazarusProjetos" and project name is "project1" and form/unit is "unit1"

Josh

  • Hero Member
  • *****
  • Posts: 1458
Re: Abstract method called when trying to save a new Form
« Reply #9 on: April 19, 2023, 08:57:29 pm »
Have you tried re-building Lazarus?

Tools->Configure Build->Tick Clean All and click build.

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

wp

  • Hero Member
  • *****
  • Posts: 13574
Re: Abstract method called when trying to save a new Form
« Reply #10 on: April 20, 2023, 12:54:45 am »
Quote
TLResourceList.Sort 64 DUPLICATE RESOURCE FOUND: TACBrNFe:PNG
This is strange. I was searching the entire Lazarus installation for "TACBrNFe" and could not find it. Did you install any third-party packages? No problem with that per se, but since packages are linked into the IDE a defective package can crash the IDE.

Open "View" > "IDE Internals" > "About IDE" and remember the path written after "Primary config directory". Exit Lazarus. In the Explorer, rename this directory. When you now restart Lazarus you are using default parameters. Rebuild the IDE as Josh told you. When the IDE restarts the third party packages are gone, and hopefully the bug as well. Install the packages again, one by one, and after each installation try to reproduce the issue. When it returns you found the guilty package. Tell us which package was causing this trouble, maybe we can help you to fix it.

denerdener

  • New Member
  • *
  • Posts: 13
Re: Abstract method called when trying to save a new Form
« Reply #11 on: April 20, 2023, 01:30:02 pm »
Hi,

Tools->Configure Build->Tick Clean All and click build.

i tried this, but don't does effective.

now i will try this, 

Open "View" > "IDE Internals" > "About IDE" and remember the path written after "Primary config directory". Exit Lazarus. In the Explorer, rename this directory. When you now restart Lazarus you are using default parameters. Rebuild the IDE as Josh told you. When the IDE restarts the third party packages are gone, and hopefully the bug as well. Install the packages again, one by one, and after each installation try to reproduce the issue. When it returns you found the guilty package. Tell us which package was causing this trouble, maybe we can help you to fix it.

when im finished this tips, i will return here

this is a brazilian free package for fiscal note
Quote
TLResourceList.Sort 64 DUPLICATE RESOURCE FOUND: TACBrNFe:PNG

thanks for now

denerdener

  • New Member
  • *
  • Posts: 13
Re: Abstract method called when trying to save a new Form
« Reply #12 on: April 20, 2023, 02:26:28 pm »
Hi guys,

good morning,

i reinstalled lazarus but i keeped all added packages, after this i rebuild and i had the same issue,

so, i started to remove one by one the packages that was intalled, and i discover what package was:
Quote
xmlresource 1.0

i was install that package because was tried to convert a delphi7 project to lazarus IDE, but after this, i will try with another way.

after all, i can save my forms hehehehe,

thank you very much guys

have a nice day


*how i mark that topic was solved?
« Last Edit: April 20, 2023, 02:28:05 pm by denerdener »

wp

  • Hero Member
  • *****
  • Posts: 13574
Re: Abstract method called when trying to save a new Form
« Reply #13 on: April 20, 2023, 03:15:30 pm »
so, i started to remove one by one the packages that was intalled, and i discover what package was:
Quote
xmlresource 1.0
This package is in the examples folder of the Lazarus installation. Its description says: "Example package on how to register another resource-format into the Lazarus IDE. With this package the IDE is able to stream forms to an xml-format, instead of the usual lfm format. Note that this example only works at design-time. At run-time loading the form from the xml-resource will fail."

So, this looks very experimental, do not install it unless you absolutely know what you are doing. I doubt that this package can be of any help in converting a Delphi 7 project (did xml already exist at the times of Delphi 7?)

denerdener

  • New Member
  • *
  • Posts: 13
Re: Abstract method called when trying to save a new Form
« Reply #14 on: April 26, 2023, 08:10:58 pm »
Hi,

I must have confused the component, but now without it it's saving just fine, thank you very much.

Bye.

 

TinyPortal © 2005-2018