Skip to main content
Participant
October 21, 2012
Question

Re-Asking: Help with startup/shutdown services

  • October 21, 2012
  • 1 reply
  • 6048 views

I already tried here:

http://forums.adobe.com/thread/1084857

, and got not success.

I want a really small sample of the startup/shutdown service working. If you guys read up the above post, you'll see what I want.

I tried as the book says to do, couldnt get it to work.

Pleeease, I really need a sample so I can learn how to do it. The documentation is a little messed up.

This topic has been closed for replies.

1 reply

Inspiring
January 19, 2013

In resource ClassDescriptionTable section of <ProjectName>.fr add

Class

    {

        kStartupShutdownBoss,

        kInvalidClass,

        {

            IID_IK2SERVICEPROVIDER, kLazyStartupShutdownProviderImpl,

            IID_ISTARTUPSHUTDOWN, kStartupShutdownImpl,

        }

    },

To <ProjectName>ID.h add:
DECLARE_PMID(kClassIDSpace, kStartupShutdownBoss, kPrefix + 2)

DECLARE_PMID(kImplementationIDSpace, kStartupShutdownImpl, kPrefix + 1 )

To <ProjectName>FactoryList.h add:

REGISTER_PMINTERFACE(CStartupShutdownService, kStartupShutdownImpl)

StartupShutdownService.h

#ifndef _CStartupShutdownService_

#define _CStartupShutdownService_

#include <CPMUnknown.h>

#include <IStartupShutdownService.h>

class CStartupShutdownService:

    public CPMUnknown<IStartupShutdownService>

{

public:

    CStartupShutdownService(IPMUnknown *boss);

    virtual ~CStartupShutdownService();

    virtual void Startup();

    virtual void Shutdown();

};

#endif

StartupShutdownService.cpp

#include "VCPlugInHeaders.h"

#include "StartupShutdownService.h"

#include "ID.h"

#include <CAlert.h>

CREATE_PMINTERFACE(CStartupShutdownService, kStartupShutdownImpl)

CStartupShutdownService::CStartupShutdownService(IPMUnknown *boss)

    :CPMUnknown(boss)

{

}

CStartupShutdownService::~CStartupShutdownService()

{

}

void CStartupShutdownService::Startup()

{

    //TODO after startup actions

}

void CStartupShutdownService::Shutdown()

{

   //TODO after sgutdown actions   

}

jochens5907408
Known Participant
June 22, 2016

Hi Mimesis,

I've followd yor recommendations on CS2, but the StartupShutdownService::Startup()-method is not executed while the plug-in is loaded to ID CS2.

May you provide me the exact steps to do/implemented or a working project using the StartupShutdownServices at CS2, because we want to start out reimplementation at CS2.

For your information, we hade implemented a similar plug-in with CS2 several years ago, which worked with the named service. But that plug-in was lost unfortunately.

Please help us, to get that services Startup()-method executed at the respecitve stage of plug-in-registration.

Kind regards

Jochen Seliger