unit Unit3;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
  ComObj, ActiveX, PartWrap_TLB, StdVcl;

type
  TPart = class(TAutoObject, IPart)
   procedure Deinit; safecall;
    procedure Init(ParentHandle: Integer; const UserName,
      Password: WideString); safecall;
    procedure ShowForm(const FormName: WideString); safecall;

  end;

implementation

uses ComServ, Unit2, Classes;

procedure TPart.Deinit;
begin
 Unit2.Deinit();
end;

procedure TPart.Init(ParentHandle: Integer; const UserName,
  Password: WideString);
var
 ls: TStringList;
begin
 ls := TStringList.Create();
 ls.Add('USER NAME=' + UserName);
 ls.Add('PASSWORD=' + Password);
 Unit2.Init(Cardinal(ParentHandle), ls);
 Unit2.SetVisiblePages([1..3]);
end;

procedure TPart.ShowForm(const FormName: WideString);
begin
 Unit2.ShowForm(String(FormName));
end;

initialization
  TAutoObjectFactory.Create(ComServer, TPart, Class_Part,
    ciMultiInstance, tmApartment);
end.
