Document operation plug-in

Log-in or register.

Implementing an Operation

From technical point of view an Operation plug-in is a COM class placed in a category CATID_DocumentOperation and implementing an IDocumentOperation interface.

The IDocumentOperation interface is declared in the type library of RWProcessing.dll.

// "BC429154-A2B8-4808-A383-82517A57D209"
interface IDocumentOperation : IUnknown
{
    HRESULT '''NameGet'''(
        [in] IOperationManager* a_pManager,
        [out] ILocalizedString** a_ppOperationName);
    HRESULT '''ConfigCreate'''(
        [in] IOperationManager* a_pManager,
        [out] IConfig** a_ppDefaultConfig);
    HRESULT '''CanActivate'''(
        [in] IOperationManager* a_pManager,
        [in] IDocument* a_pDocument,
        [in] IConfig* a_pConfig,
        [in] ISharedStateManager* a_pStates);
    HRESULT '''Activate'''(
        [in] IOperationManager* a_pManager,
        [in] IDocument* a_pDocument,
        [in] IConfig* a_pConfig,
        [in] ISharedStateManager* a_pStates,
        [in] RWHWND a_hParent,
        [in] LCID a_tLocaleID);
};

Because the operation plug-ins follow the cooperating plug-ins pattern, each method has the operations manager as its first argument.

  • NameGet method returns a localized name of the operation.
  • ConfigCreate creates a default configuration object for the operation.
  • CanActivate checks if the application can be run with the given document, configuration and view states. Configuration may be NULL. Returns S_OK/S_FALSE.
  • Activate runs the operation. Operations should in general not interact with user.
GUID CATID_DocumentOperation =
    {0x902734f0, 0x00a5, 0x477c, {0xb3, 0x36, 0xb9, 0x22, 0x1d, 0x46, 0xa3, 0xdd}};

Recent comments

user icon Anonymous
I wish there were...
What about ICL files?