> Another Newbie question.
> I have several different user sites, each with slightly different
> versions of the programme.  To date, I have accomodated this by having
> the programme's unchanging core units in an application directory and
> individual versions of the units that differ in seperate site
> directories.  This has worked well.
> 
> What I now want to do is to have a menu option on the Main form (and a
> modal "report definition" form that is called by the menu's on click
> event) available for one site only and none of the others.
> 
> I know I can show a message saying "This report not available" for each
> of the other sites if they select that menu option (not nice) but how do
> I avoid having to declare a dummy "report definition" form in each of
> the other sites versions of the project.
> 
> I hope that I have described the situation clearly enough.

Assumption: Delphi4
1. Newbie solution.
    a. Make a project group and have 1 project for each site.
    b. Use conditional compilation to include or exclude a line that makes the
        offending menuitem visible or invisible.
        {$IFDEF OPT_SHOWSPECIALREPORT} menuitem.visible := True; {$ENDIF}
    c. Place the OPT_SHOWSPECIALREPORT define in the project options for the
        site that wants to the see the report.  Make the menuitem visible property 
false
        by default.
2. Non Newbie expandable solution
    imbed reports in DLLs and then have them registered as being present at runtime.
    in each dll have a RegisterMenuItem function that sets the Caption and
    Tag to a preset number (Enumerated value?) for each report. Can also set any other
    properties such as hint, imageindex etc.
    All you will need to do then is hold an array of DLL handles (indexes by the
    unique number) and the menuitems on click can execute the relevent report
    by calling a 'GenerateReport' method in each dll.

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to