Tools API


Open Tools API

Custom Forms


Where the old API required you to derive a class from TIExpert, the new API has you implement one or more interfaces. You wizard class can inherit from any base class, but usually you will use TInterfacedObject.

Your wizard must implement IOTAWizard and its inherited interfaces (in particular, IOTANotifier, even though Delphi doesn't call any notifier methods*).

An add-in wizards implements, IOTAWizard and IOTANotifier. Delphi never calls the WizardState and Execute methods

A menu wizard was called a standard wizard in the old API. It implements IOTAMenuWizard, IOTAWizard, and IOTANotifier.

Form and project wizards must implement IOTARepositoryWizard, IOTAWizard, and IOTANotifier. Delphi never calls WizardState. Form wizards implement IOTAFormWizard, and project wizards implement IOTAProjectWizard.

To register a wizard in a package, call RegisterPackageWizard, which is the equivalent of RegisterLibraryExpert in the old API.

In a DLL, though, do not call RegisterPackageWizard. Instead, use the wizard services to add your wizard. In your DLL's Terminate procedure, use the wizard services to remove your wizard. You must do this because Delphi 4 has a bug that causes an access violation if you register your wizard in any other way.

*Note: If your wizard is in a package, and you register your wizard by calling the register procedure that Delphi passes to your DLL's initialization function, Delphi will call your wizard's Destroyed method, which it implements from the IOTANotifier interface. Delphi then crashes with an access violation, so this tidbit of information isn't particularly useful.

Copyright © 1998 Tempest Software, Inc. All rights reserved.