Hi Hans
For example here:
procedure MainProc;
var view: TfrmMain; cmd: ICmdLineParams = nil;
begin
fpgApplication.Initialize;
if fpgApplication.GetInterface(ICmdLineParams,cmd) then begin
if cmd.HasOption('style') then fpgStyleManager.SetStyle(cmd.GetOptionValue('style'))
else fpgStyleManager.SetStyle('carbide-dark'); /// carbide Plastic Dark fusion-dark
end;
view := TfrmMain.Create(nil);
fpgApplication.MainForm:= view;
try
view.LogParser:= CreLogParserRTV(true);
view.Show;
fpgApplication.Run;
finally
view.Free;
end;
end;
The fpgApplication doesn't implement "ICmdLineParams", but exposes it as a property of TfpgApplication.
This means you can get the interface off of the object where it feels natural but implement it in another class, which again means the interface's refcount won't 'Free' the /Host-object/ prematurely

Very Handy with COM-Interfaces...
<edit>You can even host it in the 'private' visibility section, as can be seen below:
TfpgApplicationBase = class(TfpgComponent, ICmdLineParams)
private
FMainForm: TfpgWidgetBase;
FTerminated: boolean;
FCritSect: TCriticalSection;
FWakeChannel: IWakeChannel;
FHelpKey: word;
FHelpFile: TfpgString;
FCmdLineParams: ICmdLineParams;
FDesignedDPI: integer;
function GetForm(Index: Integer): TfpgWidgetBase;
function GetFormCount: integer;
function GetTopModalForm: TfpgWidgetBase;
function GetHelpFile: TfpgString;
function GetCmdLineParamsInterface: ICmdLineParams;
property CmdLineParams: ICmdLineParams read GetCmdLineParamsInterface implements ICmdLineParams;
protected
...
In the 'getter', Graeme thinks ahead and keeps the interface internally as an interface, thus it's ready if you need it again ...and being an interface, it manages its own lifetime, eventually when the application destroys, it goes out of scope and bye bye... Nifty right

function TfpgApplicationBase.GetCmdLineParamsInterface: ICmdLineParams;
begin
if not Assigned(FCmdLineParams) then
FCmdLineParams := TfpgCmdLineParams.Create;
Result := FCmdLineParams;
end;
</edit>Regards Benny