Skip to main content
Participant
October 21, 2012
Question

Re-Asking: Help with startup/shutdown services

  • October 21, 2012
  • 1 reply
  • 6050 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
July 7, 2016

Hi Jochen,

I noticed you don't need StartupShutdownService.

This thread isn't that you started.

Your question is changing.

Start another thread.

I do not want to cooperate with you.


Hi Norio,

my problem with the StartupShutdownService is fixed now.

I may add an own menu with three sub items with the IMenuManager form the

Startup()-method sucessfully.

Now I want to read an parse an provided XML-Order-file by selecting the

respective sub item of the named menu.

Therefor I'd like the xmlcataloghandler sample with some adaptions(e.g. I will

not need the samples StartupShutdownService.

I've copyed most of the sample files to my project source folder, added the type

declarations from XCatHnd.h to my UIEID.h-file, retyped all the header-names at

the sample files from XCatHnd.h to UIEID.h.

But now I get Typeredefintion errors.

What is the best way to incorporate the xmlcataloghandler sample into may

project?

That question is a new one.

Regards

Jochen Seliger

Norio Kawamura <forums_noreply@adobe.com> hat am 7. Juli 2016 um 02:16

geschrieben:

Norio Kawamura created the

discussion

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

To view the discussion, visit:

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

>