AcRxObject AcPublishReactor
class AcPublishReactor : public AcRxObject;
acpublishreactors.h
Clients who want notifications of key publish events can derive from this class and implement their own reactors.
To derive a class to receive reactor notifications from the AcPublish module:
class AcTestReactor : public AcPublishReactor { public: void OnAboutToBeginBackgroundPublishing(AcPublishBeforeJobInfo *pInfo); void OnAboutToBeginPublishing(AcPublishBeginJobInfo *pInfo); void OnBeginSheet(AcPublishSheetInfo *pInfo); void OnBeginAggregation(AcPublishAggregationInfo *pInfo); void OnAboutToEndPublishing(AcPublishReactorInfo *pInfo); void OnAboutToMoveFile(AcPublishReactorInfo *pInfo); void OnEndPublish(AcPublishReactorInfo *pInfo); void OncanceledOrFailedPublishing(AcPublishReactorInfo *pInfo); virtual ~AcTestReactor() {}; AcTestReactor() {}; };
If you need the final DWF file name, you can get it from the AcPublishReactorInfopInfo object using the method dwfFileName().
To add and remove your AcTestReactor instance:
if(!acrxServiceIsRegistered(/*MSG0*/"AdskPublish")) { acrxLoadModule(/*MSG0*/"AcPublish.crx", false, false); }
2. Once the AcPublish module is loaded, use the global method AcGlobAddPublishReactor() to add your reactor. For example:
HINSTANCE hInst = ::GetModuleHandle(/*MSG0*/"AcPublish.crx"); if ((hInst)) { ACGLOBADDPUBLISHREACTOR pAcGlobAddPublishReactor = (ACGLOBADDPUBLISHREACTOR)GetProcAddress(hInst, /*MSG0*/"AcGlobAddPublishReactor"); pAcGlobRemovePublishReactor = (ACGLOBREMOVEPUBLISHREACTOR)GetProcAddress( hInst, /*MSG0*/"AcGlobRemovePublishReactor"); if (pAcGlobAddPublishReactor != NULL) pAcGlobAddPublishReactor(&testReactor); }
NOTE: Clients are responsibile for making sure that AcPublish.crx is loaded and unloaded, and for adding and removing their reactors.