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 23, 2016

Hi Alo,

that information I've alredy found and have implemented my code regarding tis

informetion.

But the my StartupShutdownService::Startup()-Method is not reached, because

obviusely the StartupShutdownService is not executed by the

plug-in-registering-functionality.

The plug-in it self is loaded without any error.

I've got several recommendations and heve searched by myself.

But all these samples basicmenu, snippedrunner and paneltreeview use another

approach.

Here the resources are defnied within the ID.fr file and are processed

obviously by the odrfz.

At none of these cases the StartupShutdownService::Starup()-method is reached at

plug-in(ID)-Startup.

Kind regards

Jochen Seliger

Alo Lohrii <forums_noreply@adobe.com> hat am 23. Juni 2016 um 09:12

geschrieben:

Alo Lohrii marked Nimesis's reply on Re-Asking: Help with startup/shutdown

services as helpful.

>

Community Expert
June 23, 2016

Are you facing the issue only on CS2, unfortunately i don't have access to CS2 SDK and dev env so can't try to spin up a sample for you. If you could reproduce the issue in CS4 onwards and send me the code i will be happy to look into it and see if i can help resolve the issue.

-Manan

-Manan