Recent

Author Topic: OnGuard example problems  (Read 8962 times)

IPguy

  • Sr. Member
  • ****
  • Posts: 385
OnGuard example problems
« on: March 08, 2011, 04:40:06 am »
I'm just getting started with OnGuard and am unable to the ExSelect example to compile.  (or any other of the examples...)

I pulled v1.13 from the SVN and installed the package.  I do see the ONGuard widgetset installed in the IDE.
With the example open, I did install the OnGuard component.

When I attempt to compile it, I get: 
Fatal: Can't find unit OnGuard used by Excele1.

Suggestions?

Using win32, 0.9.31, 29671, 2.4.2


IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: OnGuard example problems
« Reply #1 on: March 09, 2011, 02:56:35 am »
Bump.
Any suggestions how to debug this?

I installed a fresh copy of Laz (win32-0.9.31-29747-2.4.2 ...), and copied OnGuard 1.13 into the component directory, compiled and installed it.  Again, it does show up in the IDE, but when I open a new application, place TOgMakeCodes on the new form and compile it, Lazarus complains that it cannot find "onguard". 

Question:  When a component is added to the IDE and a name is added to the "uses" stmt,
1) where does the IDE expect to find the newly added component, and
2) what is it looking for?  just the "component".pas file?




Peter F

  • New Member
  • *
  • Posts: 13
Re: OnGuard example problems
« Reply #2 on: March 09, 2011, 06:43:29 am »
IPguy,

Did you try one of the examples provided?

Cheers,

Peter

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: OnGuard example problems
« Reply #3 on: March 09, 2011, 09:33:27 am »
Afaik in Lazarus, component directories are not included in the global path manually as with Delphi. Lazarus keeps directory settings per component.

However to make them active, you must create a dependancy from your project to the component.

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: OnGuard example problems
« Reply #4 on: March 09, 2011, 10:41:19 am »
Afaik in Lazarus, component directories are not included in the global path manually as with Delphi. Lazarus keeps directory settings per component.

However to make them active, you must create a dependancy from your project to the component.
I played around with it a bit: when you drop an onguard control on a form a dependency is added, but the paths are not inherited. I noticed that the package setting is 'Design time only', which does not seem right. Setting it to 'Design time + run time' and recompiling the package solves the problem

(Alternatively you could set 'use design time packages' in Project Options / Miscellaneous, this also inherits the paths. I would call that a workaround and not a solution)

BTW: the behaviour seems to have changed in Lazarus SVN r29454. It looks as if in older revisions it *would* have compiled without change.

Gr.
Dirk.

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: OnGuard example problems
« Reply #5 on: March 09, 2011, 02:24:02 pm »
Thanks for the hints !
Peter - Yes, I tried several of the examples - same issue.
Dirk - I'll try your suggestion when I get home tonight.  I had not noticed the package settings you mentioned.  (Another opportunity for learning approaches.)

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: OnGuard example problems
« Reply #6 on: March 10, 2011, 03:59:49 am »
Finally !
Process:
1) delete the onguard component from my current Laz application
2) export a fresh copy of onguard from SVN to my current laz component directory
3) Open the onguard .lpk package
4) change the Package Type from "Designtime only" to "Designtime and Runtime"
5) Compile the package
6) Use / Install the package

and now the OnGuard examples compile cleanly.

Thanks all.

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: OnGuard example problems
« Reply #7 on: March 10, 2011, 04:01:59 am »
And that brings up my next question:

What is the value of having a package installed as "Designtime only" vs "Runtime only" vs "Designtime and Runtime"?

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: OnGuard example problems
« Reply #8 on: March 10, 2011, 10:12:37 am »
What is the value of having a package installed as "Designtime only" vs "Runtime only" vs "Designtime and Runtime"?
One of the reasons is to prevent bloating the Lazarus IDE.
See http://wiki.lazarus.freepascal.org/Lazarus_Packages#Design_Time_vs_Run_Time_package

Gr.
Dirk.

 

TinyPortal © 2005-2018