Library PDFlibAX;
{$I ..\Lib\PDFlibDefines.inc}
{$IFDEF WIN64}
{$LIBSUFFIX '64'}
{$ELSE}
{$LIBSUFFIX '32'}
{$ENDIF}

Uses
{$IFNDEF XE2+}
  ComServ,
  ComObj,
{$ELSE}
  System.Win.ComServ,
  System.Win.ComObj,
{$ENDIF}
  PDFlibAX_TLB In 'PDFlibAX_TLB.pas',
  PDFlibActiveX In 'PDFlibActiveX.pas' {PDFlibrary: CoClass};

Const
  CATID_SafeForScripting: TGUID = '{7DD95801-9882-11CF-9FA9-00AA006C42C4}';
  CATID_SafeForInitializing: TGUID = '{7DD95802-9882-11CF-9FA9-00AA006C42C4}';

Function DllRegisterServer: HResult; Stdcall;
Var
  ClassKey: String;
Begin
{$IFNDEF XE2+} Result := ComServ.DllRegisterServer;
{$ELSE} Result := System.Win.ComServ.DllRegisterServer;
{$ENDIF}
  Try
    CreateRegKey('PDFlibAX.PDFlibrary', '', 'PDFlibAX.PDFlibrary Object');
    CreateRegKey('PDFlibAX.PDFlibrary\Clsid', '', GUIDToString(CLASS_PDFlibrary));
    ClassKey := 'CLSID\' + GUIDToString(CLASS_PDFlibrary);
    CreateRegKey(ClassKey + '\Implemented Categories', '', '');
    CreateRegKey(ClassKey + '\Implemented Categories\' + GUIDToString(CATID_SafeForScripting), '', '');
    CreateRegKey(ClassKey + '\Implemented Categories\' + GUIDToString(CATID_SafeForInitializing), '', '');
  Except
  End;
End;

Exports
  DllGetClassObject, DllCanUnloadNow, DllRegisterServer, DllUnregisterServer;
{$R *.TLB}
{$R *.RES}

Begin

End.
