PGetPrivateData

Gets the handle to the buffer containing private data (not a private string) for the specified graphic, image, page, mas ter page, story, text block, or publication. PageMaker retrieves only the private data associated with the specified developer, plug-in, and private ID.


Query constructor

This constructor for this class has more parameters than most queries.

PGetPrivateData(const char * sDeveloperID, const char * sPlugInID, shortcTargetClass, unsigned long nTypeFlag, unsigned long nTargetID);

const char * sDeveloperID;

Four-character string representing your name or company name (e.g. "ADBE" for Adobe)
const char * sPlugInID;
Four-character string representing plug-in (e.g., "KYLN" for Keyline plug-in)
short cTargetClass;
kClassObject for imported graphics and images, and for PageMaker-drawn lines, boxes, ovals, polygons, or text blocks
kClassStory for stories
kClassPub for publication (current publication only)
kClassPage for page
kClassMaster for master page
unsigned long nTypeFlag;
Identifier you defined to distinguish between types of private data for same cTargetClass (-1 and -2 are notallowed).
unsigned long nTargetID;
Internal PageMaker identifier for element (graphic, image, text block, story, page, or master page) to which private data is associated

0 (zero) for publication (PageMaker gets private data for current publication only)


Query results

unsigned long nSize;
Size of private data
short cPlatform;
0 for Windows
1 for Macintosh
Handle hPrivateData;
Handle to buffer containing private data
Translation required: cPlatform. If the publication is transferred to a different platform (e.g., Windows to Macintosh), the plug-in is responsible for translating the data to the byte-order appropriate to the platform.

Exceptions. PGetPrivateData throws an exception if:

Five parameters needed to identify data. PageMaker requires five parameters to identify private data: Free memory. PageMaker allocates a block of global memory for the private data. The plug-in must free the block. Use MMFree, a cross-platform, memory-management routine.

Example.

PGetPrivateData privateData("ADBE", "KYLN", classobject, 0, 15);
const char * ch = MMLock(privateData.hPrivateData);
...
MMFree(privateData.hPrivateData);


See also

The PGetPrivateList and PGetPrivateString queries

The PDeletePrivateData, PPrivateData, and PPrivateString commands


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support