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

  1. /*
  2.  *--- PHandleQuery.cpp ----------------------------------------------------
  3.  * Copyright (c) 1995-96 Adobe Systems Incorporated.  All rights reserved.
  4.  * Created on Thu, Oct 12, 1995 @ 10:00 PM by Paul Ferguson.
  5.  *
  6.  * Description:  For notes about this class, refer to the
  7.  * PCL documentation file: PHandleQuery.html
  8.  *-------------------------------------------------------------------------
  9.  */
  10.  
  11. #include "PMMemory.h"
  12. #include "PMCQErrs.h"
  13. #include "PQuery.h"
  14. #include "PHandleQuery.h"
  15.  
  16. #include "CIBasic.h"
  17. #include "CIInterfaceManager.h"
  18. #include "PMInterfaceIDs.h"
  19.  
  20. extern PMMessage * gPMMessage;
  21.  
  22. PHandleQuery::PHandleQuery()
  23. : itsHandle(0), replyPtr(0)
  24. {
  25.  
  26. }
  27.  
  28. PHandleQuery::PHandleQuery (const ePMQuery op)
  29. : itsHandle(0), replyPtr(0)
  30. {
  31.     PQuery query(op, itsHandle);
  32.     InitHandle();
  33. }
  34.  
  35. PHandleQuery::PHandleQuery(ePMQuery op, PRequestBuf& request)
  36. : itsHandle(0), replyPtr(0)
  37. {
  38.     PQuery query(op, request, itsHandle);
  39.     InitHandle();
  40. }
  41.  
  42. PHandleQuery::~PHandleQuery()
  43. {
  44.     if (itsHandle)
  45.     {
  46. /*        CIBasic * basicInterface;
  47.         gPMMessage->pInterfaceMgr->AcquirePMInterface(PMIID_BASIC, (void **) &basicInterface);
  48.         basicInterface->PMMemFree(bufHdl);
  49.         gPMMessage->pInterfaceMgr->ReleasePMInterface(basicInterface); */
  50.          MMFree(itsHandle);
  51.     }
  52. }
  53.  
  54.  
  55. void PHandleQuery::InitHandle() throw (PMErr)
  56. {
  57.     if (itsHandle == NULL)
  58.         throw CQ_FAILURE;
  59.  
  60.     replyPtr = (const char *) MMLock(itsHandle);
  61. }
  62.  
  63. // end of PHandleQuery.cpp
  64.