Recent

Author Topic: UniqueInstance package  (Read 12417 times)

aceinfinity

  • New member
  • *
  • Posts: 9
UniqueInstance package
« on: February 15, 2014, 01:46:35 am »
I'm confused at why this package: https://code.google.com/p/luipack/downloads/detail?name=uniqueinstance-1.0.zip&can=2&q=

Doesn't seem to work for me... I keep getting an error at project load that it can't find the component class 'TUniqueInstance' which exists in uniqueinstance.pas. "It is not registered via RegisterClass and no lfm was found."

I've check other packages that I'm using and I don't see anything different. My code has specified to use the 'UniqueInstance' unit properly, I'm just curious why it doesn't seem to work. The package compiled just fine.

I've been working with Pascal for only a few days now, my experience is with other programming languages.. Any help would be appreciated. :)

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: UniqueInstance package
« Reply #1 on: February 15, 2014, 03:15:31 am »
So you have opened the lpk package in Lazarus, compiled and installed it, then rebuilt Lazarus?

aceinfinity

  • New member
  • *
  • Posts: 9
Re: UniqueInstance package
« Reply #2 on: February 15, 2014, 04:55:26 am »
I have opened the lpk package, compiled and installed, but I definitely didn't attempt to rebuild lazarus, that's new to me... Thanks for the hint. I read that this is a normal procedure for Lazarus because it doesn't support dynamic packages and components can only be linked at compile time.

I've had a few issues with Zeos though too. My latest message during compilation for my program:
Code: [Select]
lr_db_zeos.pas(8,56) Fatal: Can not find unit LR_DBComponent used by LR_DB_Zeos.
This 'unit' seems to exist in lr_dbcomponent.pas... When I install the lazreport.lpk package, it asks me if I want to rebuild Lazarus and after a rebuild, debugging prompts me with the same error? Is there some trick here that I don't know about yet?

I did manage to get the UniqueInstance to work after a rebuild of Lazarus though with your help thanks.

edit: Hmm, attempting to compile and install the lr_zeosdb.lpk package gives me that same error as above too. Also, TDbfDB, and SqlDB addons for this component show the same message about not being able to find the unit LR_DBComponent.

edit: I seemed to have fixed that, but now an issue when it comes to lr_dbcomponent.pas:
Code: [Select]
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(13,48) Error: Identifier not found "TfrNonVisualControl"
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(13,48) Error: class type expected, but got "<erroneous type>"
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(29,15) Error: There is no method in an ancestor class to be overridden: "TLRDataSetControl.SetName(const AnsiString);"
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(31,15) Error: There is no method in an ancestor class to be overridden: "TLRDataSetControl.AfterLoad;"
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(32,14) Error: There is no method in an ancestor class to be overridden: "TLRDataSetControl.ExecMetod(const AnsiString,Variant,Variant,Variant,var Variant):Boolean;"
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(34,17) Error: There is no method in an ancestor class to be overridden: "constructor TLRDataSetControl.Create(TfrPage);"
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(37,15) Error: There is no method in an ancestor class to be overridden: "TLRDataSetControl.LoadFromXML(TLrXMLConfig,const AnsiString);"
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(38,15) Error: There is no method in an ancestor class to be overridden: "TLRDataSetControl.SaveToXML(TLrXMLConfig,const AnsiString);"
C:\lazarus\components\lazreport\source\lr_dbcomponent.pas(49,1) Fatal: There were 8 errors compiling module, stopping
« Last Edit: February 15, 2014, 05:33:32 am by aceinfinity »

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: UniqueInstance package
« Reply #3 on: February 15, 2014, 06:03:46 am »
LR_XXXXXXX = LazReport  that needs to be checked.
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

aceinfinity

  • New member
  • *
  • Posts: 9
Re: UniqueInstance package
« Reply #4 on: February 15, 2014, 06:05:32 am »
LR_XXXXXXX = LazReport  that needs to be checked.

I know lr_??? is really short for {LazReport}_??? but that doesn't quite tell me how to solve this problem.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: UniqueInstance package
« Reply #5 on: February 15, 2014, 06:29:26 am »
try uninstalling lazreport install all the db aware packages and then reinstall lazreport. Your latest error seems to indicate that something major has changed in the TLRDataSetControl ancestor since the last time you used it. There are 2 main reason for this
1) half finished update
2) conflicting search paths or component names from different packages.

You have to search for the reason your self. Use what ever is avaliable to you ee ctrl+Click grep search what ever it takes to search for clues of conflicts on component names or search paths.
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

aceinfinity

  • New member
  • *
  • Posts: 9
Re: UniqueInstance package
« Reply #6 on: February 15, 2014, 07:27:37 pm »
Just the ones in the addons folder for lazreports, or every single one of the zeos packages too? If this is really the case, then how do you prevent issues like this? Seems like packages/components for lazarus has been more convoluted than any other IDE I've even used...

Btw, thanks for the time you've taken to try and help. I have a deadline to fix this issue so that I can move onto other things, and I am a bit confused here currently.
« Last Edit: February 15, 2014, 07:30:22 pm by aceinfinity »

aceinfinity

  • New member
  • *
  • Posts: 9
Re: UniqueInstance package
« Reply #7 on: February 15, 2014, 10:53:07 pm »
I've re-installed lazarus and tried everything once again, no avail...

Pascal just seems like a mess, and the querks of the Lazarus IDE don't help things much either. This is frustrating. I get these errors now:
Code: [Select]
C:\lazarus\components\lazreport\source\lr_class.pas(970,35) Error: Identifier not found "TOnDBImageRead"
C:\lazarus\components\lazreport\source\lr_class.pas(970,35) Error: Error in type definition
C:\lazarus\components\lazreport\source\lr_class.pas(1180,44) Error: Identifier not found "TOnDBImageRead"
C:\lazarus\components\lazreport\source\lr_class.pas(1180,44) Error: This kind of property can't be published
C:\lazarus\components\lazreport\source\lr_class.pas(1388,34) Fatal: There were 4 errors compiling module, stopping

It points to this:
Code: [Select]
// If wanted, you can use your own handler to determine the graphic class of the image
property OnDBImageRead: TOnDBImageRead read FOnDBImageRead write FOnDBImageRead;
« Last Edit: February 15, 2014, 11:05:01 pm by aceinfinity »

aceinfinity

  • New member
  • *
  • Posts: 9
Re: UniqueInstance package
« Reply #8 on: February 16, 2014, 01:17:09 am »
Where is the file lr_zeos_img.inc? I see it included in the package, but it's nowhere to be seen or found anyplace...

edit: It seems that those addons for Zeos only exist in svn repositories for lazarus? Do I have to use the svn version instead of the official version for 1.0.14 then?
« Last Edit: February 16, 2014, 01:35:32 am by aceinfinity »

userx-bw

  • Full Member
  • ***
  • Posts: 178
Re: UniqueInstance package
« Reply #9 on: February 19, 2014, 06:10:56 pm »
Where is the file lr_zeos_img.inc? I see it included in the package, but it's nowhere to be seen or found anyplace...

edit: It seems that those addons for Zeos only exist in svn repositories for lazarus? Do I have to use the svn version instead of the official version for 1.0.14 then?

maybe just uninstall Lazarus all together, then remove anything that has to do with Lazarus, (just not FPC) if you are using Linux find the hidden  .Lazarus folder maybe delete everything in that too, I do, if you have other add on packages save them so you can re install them   then reinstall Lazarus and then install UniqueInstance again then go from there

it might save some time

I use the  official version for 1.0.14 and have done this with  some problems I have come across and it fixed it for me, I'm using Linux version, and UniqueInstance and I have no problems with that Package.

just a suggestion
My Finished Projects
https://sourceforge.net/projects/mhsetroot/
https://sourceforge.net/projects/gmhsetrootfreepascalfrontend/

HP Elitetbook 6930p Dual Core Intel vPro 2.66 gHz
VOID (Linux) 64bit

Fred vS

  • Hero Member
  • *****
  • Posts: 3780
    • StrumPract is the musicians best friend
Re: UniqueInstance package
« Reply #10 on: February 19, 2014, 09:46:05 pm »
Hello.
You may use also :

https://github.com/fredvs/runonce_postit
(Inspired by Silvio Clecio / LSRunOnce)

It is cross platform, works for console too.
With LCL, fpGUI and console examples.
« Last Edit: February 19, 2014, 09:49:06 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

aceinfinity

  • New member
  • *
  • Posts: 9
Re: UniqueInstance package
« Reply #11 on: February 20, 2014, 06:29:13 am »
I would but that won't help me. I need to get the existing packages working with the existing project. I'm trying to get a previous programmers project to compile so that I can take over this project by a client's request.

I'd just like to understand what the best way to do this would be. I've also got a deadline, so if anybody has any suggestions that would help me for getting this package issue sorted, I would very much appreciate it! :)

CM630

  • Hero Member
  • *****
  • Posts: 1609
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: UniqueInstance package
« Reply #12 on: February 20, 2014, 09:54:00 am »
As @TAAZ already mentioned, you rather have a problem with LazReport. Probably you could get an answer here: http://forum.lazarus.freepascal.org/index.php/board,52.0.html

Generally, you should be able to ran your app without installing the package in the following way:
1. Unpack UniqueInstance in you app folder of subfolder.
2. Trough the Lazrus IDE->File->Open-> open all the *.pas files. Then while viewing them go to Project->Add editor file to project for all the files (maybe the IDE will ask you to add other files, I'm not quite sure).
3. Then in the form, which uses the  UniqueInstance, after USES add the name of the dependency.

4. Most likely you would have to create an  UniqueInstance dynamically.
« Last Edit: February 20, 2014, 10:00:21 am by paskal »
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

aceinfinity

  • New member
  • *
  • Posts: 9
Re: UniqueInstance package
« Reply #13 on: February 20, 2014, 02:49:41 pm »
I'll take your word for it. How would I go about fixing that issue though since I have already tried to reinstall lazreports without success?

CM630

  • Hero Member
  • *****
  • Posts: 1609
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: UniqueInstance package
« Reply #14 on: February 21, 2014, 03:04:36 pm »
I have never used LazReport, so once again I would advice you to ask for an answer here. Since you have inherited someones project, maybe there is some version conflict.
You could try to clean install the Lazarus version in which the project was made, instead of the current one. After that, I'm out of ideas.
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018