home *** CD-ROM | disk | FTP | other *** search
- /*
- *--- PPrivateData.cpp ----------------------------------------------------
- * Copyright (c) 1995-96 Adobe Systems Incorporated. All rights reserved.
- * Created on Thu, Oct 12, 1995 @ 10:48 PM by Paul Ferguson.
- *
- * Description: For notes about this class, refer to the
- * PCL documentation file PPrivateData.html
- *-------------------------------------------------------------------------
- */
-
- #include <string.h>
-
- #include "PMCQErrs.h"
- #include "PPrivateData.h"
- #include "PRequestBuf.h"
- #include "PCommand.h"
-
- PPrivateData::PPrivateData
- ( const char * sDeveloperID,
- const char * sPluginID,
- short cTargetClass,
- unsigned long nTypeFlag,
- unsigned long nTargetID,
- short bChange,
- PMHandle hPrivateData,
- unsigned long nSize ) throw (PMErr)
- {
- if (strlen(sDeveloperID) != 4 || strlen(sPluginID) != 4)
- throw CQ_INVALID_CQ_ARG;
-
- char buf[100]; // plenty big to hold everything.
- PRequestBuf request(buf);
- request << sDeveloperID
- << sPluginID
- << cTargetClass
- << nTypeFlag
- << (short) 1 // only one add at a time.
- << nTargetID
- << bChange
- << (long) hPrivateData
- << nSize;
-
- // NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!
- // If the object has private data, and bChange == false,
- // an exception (CQ_PDATA_ALREADY_EXISTS) will be thrown.
- // If you don't want your plug-in to fail, you must
- // handle the exception.
- PCommand command(pm_privatedata, request);
- }
-
- // end of PPrivateData.cpp
-