borcvsdllunit.pas

来自「CVS IDE plugin for Borland Delphi this 」· PAS 代码 · 共 81 行

PAS
81
字号
unit BorCVSdllUnit;

{$IFDEF BCB}
{$OBJEXPORTALL ON}
{$ENDIF BCB}

interface

uses
  Windows,
  ToolsAPI;

// This function needs to be interface-visible, otherwise
// C++Builder 5 complains about a missing EXTDEF symbol
// for this export.
// Do not call this function yourself.
function InitWizard(const BorlandIDEServices: IBorlandIDEServices;
  RegisterProc: TWizardRegisterProc;
  var Terminate: TWizardTerminateProc): Boolean; stdcall;

implementation

uses
  TBorCvsWizardunit;

const
  InvalidIndex = -1;

var
  FExpertIndex: Integer = InvalidIndex;

{ Remove the wizard from the IDE. }

procedure FinalizeWizard;
var
  WizardServices: IOTAWizardServices;
begin
  if FExpertIndex <> InvalidIndex then
  begin
    Assert(Assigned(BorlandIDEServices));

    WizardServices := BorlandIDEServices as IOTAWizardServices;
    Assert(Assigned(WizardServices));

    WizardServices.RemoveWizard(FExpertIndex);

    FExpertIndex := InvalidIndex;
  end;
end;

{ Register the wizard. }

function InitWizard(const BorlandIDEServices: IBorlandIDEServices;
  RegisterProc: TWizardRegisterProc;
  var Terminate: TWizardTerminateProc): Boolean; stdcall;
var
  WizardServices: IOTAWizardServices;
begin
  Result := (BorlandIDEServices <> nil);
  if Result then
  begin
    Assert(ToolsAPI.BorlandIDEServices = BorlandIDEServices);

    Terminate := FinalizeWizard;

    WizardServices := BorlandIDEServices as IOTAWizardServices;
    Assert(Assigned(WizardServices));

    FExpertIndex := WizardServices.AddWizard(TBorCvsWizard.Create as IOTAWizard);

    Result := (FExpertIndex >= 0);
  end;
end;

exports
  InitWizard name WizardEntryPoint;

// ---------------------------------------------

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?