Skip to main content
Participant
October 21, 2012
Question

Re-Asking: Help with startup/shutdown services

  • October 21, 2012
  • 1 reply
  • 6055 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.

>

jochens5907408
Known Participant
June 27, 2016

There should be no need for kUIEStartupShutdownProviderImpl, use kCStartupShutdownProviderImpl as I said.

I just checked CS2 XCatHnd.fr, same kCStartupShutdownProviderImpl there.


Hi Dirk,

I've checked my test of the xmlcataloghandler sample.

There is coded within the XCatHnd.fr

Class

{

kXCatHndStartupShutdownServiceBoss,

kInvalidClass,

{

/** Implementation of IStartupShutdownService

@see XCatHndStartupShutdown */

IID_IAPPSTARTUPSHUTDOWN, kXCatHndStartupShutdownImpl,

/** Implementation to IK2ServiceProvider to identify the service type as

startup-shutdown */

IID_IK2SERVICEPROVIDER, kCStartupShutdownProviderImpl,

}

},

but no FileHelper is shown at plug-in registering, although the call is

implemented

into the StartupShutdowService::Startup()-method.

Did it appear at your test?

Jochen Seliger

Dirk Becker <forums_noreply@adobe.com> hat am 27. Juni 2016 um 21:39

geschrieben:

Dirk Becker created the

discussion

"Re-Asking: Help with startup/shutdown services"

To view the discussion, visit:

https://forums.adobe.com/message/8839719#8839719

>