home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / pm65sdk / sourcecode / pagemakerclasslibrary / commands / pprivatestring.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-15  |  1.4 KB  |  51 lines

  1. /*
  2.  *--- PPrivateString.cpp --------------------------------------------------
  3.  * Copyright (c) 1995-96 Adobe Systems Incorporated.  All rights reserved.
  4.  * Created on Thu, Oct 12, 1995 @ 10:48 PM by Paul Ferguson.
  5.  *
  6.  * Description:  For notes about this class, refer to the
  7.  * PCL documentation file PPrivateString.html
  8.  *-------------------------------------------------------------------------
  9.  */
  10.  
  11. #include <string.h>
  12.  
  13. #include "PMCQErrs.h"
  14. #include "PPrivateString.h"
  15. #include "PRequestBuf.h"
  16. #include "PCommand.h"
  17.  
  18. PPrivateString::PPrivateString
  19.   (    const char *    sDeveloperID,
  20.     const char *    sPluginID,
  21.     short            cTargetClass,
  22.     unsigned long    nTypeFlag,
  23.     unsigned long    nTargetID,
  24.     short            bChange,
  25.     const char *    sPrivateString ) throw (PMErr)
  26. {
  27.     if (strlen(sDeveloperID) != 4 || strlen(sPluginID) != 4)
  28.         throw CQ_INVALID_CQ_ARG;
  29.     
  30.     char buf[100];            // plenty big to hold everything.
  31.     PRequestBuf request(buf);
  32.     
  33.     request << sDeveloperID
  34.             << sPluginID
  35.             << cTargetClass
  36.             << nTypeFlag
  37.             << (short) 1            // only one add at a time.
  38.             << nTargetID
  39.             << bChange
  40.             << sPrivateString;
  41.     
  42.     // NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!
  43.     // If the object has private data, and bChange == false,
  44.     // an exception (CQ_PDATA_ALREADY_EXISTS) will be thrown.
  45.     // If you don't want your plug-in to fail, you must
  46.     // handle the exception.
  47.     PCommand command(pm_privatestring, request);    
  48. }
  49.  
  50. // end of PPrivateString.cpp
  51.