Recent

Author Topic: EResnotFound, CreateNew, RequireDerivedFormResource  (Read 9390 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
EResnotFound, CreateNew, RequireDerivedFormResource
« on: May 23, 2013, 03:00:10 pm »
A new project I am creating is giving me this error message at runtime when try to use RX TDBDateEdit.

Quote
Project project1 raised exception class 'EResNotFound' with message;

Form resource TPopupCalendar not found. For resourceless forms CreateNew musst be used. See the global variable RequireDerivedFormResource.

In file '.\include\customform.inc ' at line 1957

If I am in a bit of hurry at the moment. If I switch to .lrs files for resource will it go away?

I am using Lazarus 1.0.6 fixes with FPC 2.6.0 fixes
Lazarus 3.0/FPC 3.2.2

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4570
  • I like bugs.
Re: EResnotFound, CreateNew, RequireDerivedFormResource
« Reply #1 on: May 23, 2013, 03:14:28 pm »
Form resource TPopupCalendar not found. For resourceless forms CreateNew musst be used. See the global variable RequireDerivedFormResource.
...
If I am in a bit of hurry at the moment. If I switch to .lrs files for resource will it go away?

No, the .res resources work well. For some reason they are not found now.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Re: EResnotFound, CreateNew, RequireDerivedFormResource
« Reply #2 on: May 23, 2013, 03:44:56 pm »
After switching to .lrs files and removing the RequireDerivedFormResource := True statement it all works now. Obviously this must be some relatively new method of resource handling in Lazarus I don't know much about.

Is there some place to get some more information?

Is it something that component designers need to adapt their code for?
Lazarus 3.0/FPC 3.2.2

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4570
  • I like bugs.
Re: EResnotFound, CreateNew, RequireDerivedFormResource
« Reply #3 on: May 23, 2013, 06:32:32 pm »
When a form does not have a resource file then it must be created with CreateNew(), as your error message said. However I understood your form has a resource file.

This feature is not very new, it has been there for some years already.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: EResnotFound, CreateNew, RequireDerivedFormResource
« Reply #4 on: May 24, 2013, 01:32:31 am »
When a form does not have a resource file then it must be created with CreateNew(), as your error message said. However I understood your form has a resource file.


Actually the problem with that approach is that even if the form does not have a resource but everything is dynamically created in the constructor if you call createNew instead, the code that creates everything never executes (aka create constructor). I have found that it is better to set the RequireDerivedFormResource to false and keep that way.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: EResnotFound, CreateNew, RequireDerivedFormResource
« Reply #5 on: May 24, 2013, 08:58:59 am »
Is there some place to get some more information?
The Lazarus changelog on the wiki has some info IIRC. Would be around 0.9.30 I think.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018