Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
}
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
>
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Manan,
as we had other problems with newer versions of ID+SDK, we've decided to start
the reimplement of our meanwhile lost first version of the plug-in build with
SC2-SDK, again with CS2 and port it afterwards to the newer versions.
What is strange, that we used at thet first version the StartupShutdownService.
The only samples (xmlcataloghandler), having at least a
XXXStartupShutdownService.cpp file I've build and run while setting a cout <<
"XYZ"; to the XCatHndStartupShutdownService::Startup()-method. But nothing was
shown at startup eaven for that sample.
The semms to me,that something at the basis is made wrong til our sucessful
time.
I have installed the CS5.5 SDK on my system.
May I send you CS5.5 sources as well?
Kind regards
Jochen Seliger
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 14:08
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8830872#8830872
>
Copy link to clipboard
Copied
If you can reproduce the issue in CS5.5 then please go ahead and send me the project with source file, lets see whats causing the issue.
Copy link to clipboard
Copied
Hi Manan,
so I'll try to build the sources with the CS5.5 SDK.
But afterwards I will send yu the resulting plug-in and the source bundle,
becaus I do not have a CS5.5-InDesign.
Kind regards
Jochen Seliger
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 14:28
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8830938#8830938
>
Copy link to clipboard
Copied
Ok, do send that but if you don't have InDesign CS5.5 then maybe you we won't be able to reproduce the issue. But lets see how far we get with this approach. Just use the existing code of CS2 and port it to CS5.5 and send the code, also send me the CS2 code as well.
Copy link to clipboard
Copied
Hi Manan,
I'm yust porting the code.
At the first(unchanged) build I've got an error concerning wrong compiler.
I'll change the project properties now and try again.
Jochen
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 14:37
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8830942#8830942
>
Copy link to clipboard
Copied
Hi Manan,
the first errror is "wrong compiler".
May you sayme where the odrfz sould be configured at VS2008?.
Jochen
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 14:37
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8830942#8830942
>
Copy link to clipboard
Copied
Hi Mana, it seems that it will not be easy to port the CS2 project to CS5.5.
So fare I made my id4sdk-Project 'USF_ID_EDIT' unhandable fot the VS2003 IDE.
So the only chance is to send you the 'xmlcataloghandler' sample source tree +
the project file for VS2003 and the resulting XMLCatalogHandler.pln.
This sample should also present the FileHelper at startup, but wiil not do it
too.
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 14:37
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8830942#8830942
>
Copy link to clipboard
Copied
Issue is i dont have InDesign CS2 installation ready with me, i would try and download the same along with the sdk and see if i can reproduce the issue.
Copy link to clipboard
Copied
Hi Manan,
that sounds fine.
So please try the xmlcataloghander sample.
That Plug-in shall present the FileHelper at startup.
Kind regards
Jochen Seliger
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 16:32
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8831217#8831217
>
Copy link to clipboard
Copied
Hi Manan,
I did not read your text corretly.
So if you could first may build the xmlcataloghandler sample with the SC4 SDK
(you have installed) to present the FileHelper at startup, we could install the
CS4 SDK, build our plug in,based on that sample, and send you the final
UIE-plug-in afterwards for general testing.
Do you agree?
Kind regards
Jochen Seliger
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 16:32
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8831217#8831217
>
Copy link to clipboard
Copied
Hi Manan,
meanwhile I can my UIE-project with the VS2003-IDE again.
But as you wrote, the CS2-SDK an ID is unavauilable for you, the question is,
what is the best version to go further.
We have the CS5.5-SDK installed, but have still truoble to port our project to
the VS2008-IDE. The test trail for our ID CS5.5 is over.
On my opinion a parcticable way could be, if you try the xmlcataloghandler
sample with the SDK you have installed (if I remember right CS4).
After you have tested the sample and it will present the FileHelper through the
XCatHndStartupShutdownService::Startup()-method, we will download the CS4-SDK,
port our plugin-code to that sample, build it and send it to you to test the
general functionality (menu adding, Filehelper-showing and
ID-Save-Eventhandling).
Is that a way you aggree to ?
Kind regards
Jochen Seliger
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 16:32
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8831217#8831217
>
Copy link to clipboard
Copied
I have installed CS2 and will update you once i am able to run some tests on it around the issue you are facing. Its late at night in India so expect an update tomorrow morning IST, hope its not too late for you
Cheers,
Manan
Copy link to clipboard
Copied
Hi Manan,
that at least sound good.
I'll send you our id4sdk.zip the project file for CS2 and for any case the
resultiong Plug-in.
Kind regards
Jochen
Manan Joshi <forums_noreply@adobe.com> hat am 23. Juni 2016 um 19:35
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8831972#8831972
>
Copy link to clipboard
Copied
i installed InDesign CS2 4.0.5 and tried building a sdk sample plugin but the plugin can't be loaded. Could you send me the sdk you are using for CS2?
Copy link to clipboard
Copied
Hi Manu,
the CS2-SDK may be downloaded from the ADOBE site.
What error do you get?
May be you generated the debug version of the plug-in.
That is due to VS2003.
There is a permanent choice at the top frame of the IDE Panel, to specify the
debug, or relase way to go.
The action for buildig a debug or a release version you will have to select from
two different pulldown menus.
If you mix the selection of the choice and the pulldown menu, you will get an
error concerning the required debug version of ID
If you get an 'invalid' error, the problem is obviosely due to the versions of
the SDK and ID itself.
So please let me know the exact error, you get.
I may send you the SDK, in case you will not be able to download it from the
ADOBE site, but on my oppinion EMail is not the best way.
May tell me the connection account and URL to an FTP-Server at yout site, I
could downlaod the bundle to?
Kind regards
Jochen Seliger
Manan Joshi <forums_noreply@adobe.com> hat am 25. Juni 2016 um 00:00
geschrieben:
Manan Joshi created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8835251#8835251
>
Copy link to clipboard
Copied
I would not target old version as an exercise, only if you really intend/need to support them. Since CS2 there have been plenty changes in the SDK, the required old compilers had nasty bugs and so forth. Using newer compilers is also a bad idea, they produce incompatible code.
Given that, the above snippet won't work in CS2: we only had kCStartupShutdownProviderImpl, instead of kLazyStartupShutdownProviderImpl. Also use IID_IAPPSTARTUPSHUTDOWN instead of IID_ISTARTUPSHUTDOWN.
The resource compiler should have reported an error on both. Check your include paths, they may be pointing to a newer SDK, or the resources aren't compiled at all.
Btw, the "new" lazy startup is invoked by an idle task when the application event loop is up and running, before that mechanism became available we used to defer execution with a scheduled command. Probably it could also have been done with an own idle task.
Dirk
Copy link to clipboard
Copied
Hi Dirk,
first of all.
We hade implemented a similar plug-in (with
StartupShudowService::Startup()-method) many years ago with CS2.
That worked at that time, but was lost unfortunately.
Now we have used again the CS2 4.0.2 SDK VS2003ID CS2 an not oaur own plug-in
and not the xmlcontenthandler sample is preseinting the FileHelpe Panel although
it is implementedto the Startup()-method.
So was the CS2 SDK changed at time of newer versiones of ID.
I may use the interface you have mentined, but first I'like to know, if the CS2
code was achanged backwards.
Kind regards
Jochen Seliger
Dirk Becker <forums_noreply@adobe.com> hat am 27. Juni 2016 um 09:44
geschrieben:
Dirk Becker created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8838380#8838380
>
Copy link to clipboard
Copied
Hi Dirk,
Ive checked my code.
I already use IIAPP
Here is my UIE.fr-snipped for Boss declaration:
Class
{
kUIEStartupShutdownBoss,
kInvalidClass,
{
/** Implementation of IStartupShutdown
@see XCatHndStartupShutdown */
IID_IAPPSTARTUPSHUTDOWN, kUIEStartupShutdownImpl, //wie in dem Adobe Text
mit geändertem Suffix
/** Implementation to IK2ServiceProvider to identify the service type as
startup-shutdown */
IID_IK2SERVICEPROVIDER, kUIEStartupShutdownProviderImpl,//wie in dem Adobe
Text mit geändertem Suffix
}
},
What is your recommendation to get the StartupService::Startup()-method to be
exetited at plug-in- loading?
Jochen Seliger
Dirk Becker <forums_noreply@adobe.com> hat am 27. Juni 2016 um 09:44
geschrieben:
Dirk Becker created the
discussion
"Re-Asking: Help with startup/shutdown services"
To view the discussion, visit:
https://forums.adobe.com/message/8838380#8838380
>
Copy link to clipboard
Copied
There should be no need for kUIEStartupShutdownProviderImpl, use kCStartupShutdownProviderImpl as I said.
I just checked CS2 XCatHnd.fr, same kCStartupShutdownProviderImpl there.
Copy link to clipboard
Copied
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
>