Unique identifier

MCanvasGraphic has unique addressspaceindependent identification of type TCanvasGraphicID that is returned by the non-virtual GetID and set by the SetID functions shown in Figure 25. This unique ID distinguishes each canvas graphic.


Canvas graphics are stored in the canvas representation and accessed by clients such as the canvas view and canvas selections. The canvas representation owns its graphics and cannot guarantee that each of its graphics will always be at the same memory location. That is, when the representation is streamed out (when the document is closed) and later streamed in (when the document is reopened), all the canvas graphics in the representation when it was streamed out are still there, but at new memory locations. Therefore, clients of canvas representation use the unique ID as a reliable way to refer to graphics.

The unique ID is generated for a canvas graphic during construction. IDs can also be constructed by clients and explicitly set to a canvas graphic, when you need to replace one canvas graphic with another, but keep the same ID (such as in an undo or redo operation). You do not usually call SetID directly.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker