Perdraw: IPersistStorage Persistent Object Server

Click to open or copy the Perdraw project files.

Click to open or copy the Include files (required).

Click to open or copy the Library files (required).

Note   To use this sample, you must first build the Register sample.

Perdraw is the third sample in a group of samples that illustrate various techniques for implementing COM object persistence. The first sample, Perserve, illustrates persistence by implementing the IPersistStream standard interface. The second sample, Pertext, illustrates persistence by implementing the IPersistStreamInit standard interface. This sample, Perdraw, illustrates persistence by implementing the IPersistStorage standard interface. The fourth sample, Perclien, shows how a client exploits the kinds of persistence provided by the Perserve, Pertext, and Perdraw server components.

The Perdraw sample introduces the CODrawPage COM object, which models a sheet of white drawing paper. CODrawPage objects expose a set of features for free-form drawing on a virtual surface using "ink" of specified color and width. CODrawPage is based on the scribble-like functionality of the COPaper object from the Stoserve sample.

See the parent topic, COM Tutorial Samples, to download global tutorial files or any HTML files about this sample.

Building SDK Samples

This sample uses the following keywords:

addref; addregnamedvalue; advise; canunloadnow; cfdrawpage; cimpiclassfactory; cimpiconnectionpointcontainer; cimpidrawpage; cimpipersiststorage; clear; cleared; clone; coconnectionpoint; codrawpage; coenumconnectionpoints; coenumconnections; createinstance; createstream; cserver; defined; delete_pointer; dllcanunloadnow; dllgetclassobject; dllmain; dllregisterserver; dllunregisterserver; enumconnectionpoints; enumconnections; failed; findconnectionpoint; findslot; getclassid; getconnectioninterface; getconnectionpointcontainer; getlasterror; getmodulefilename; getslot; getusername; handsoffstorage; initnew; inkdraw; inkstart; inkstop; isdirty; liset32; load; loaded; lock; lockserver; lstrcat; lstrcpy; lstrlen; makelong; memcpy; memset; next; nextslot; notifysinks; objectsdown; objectsup; openstream; ownthis; queryinterface; redraw; regclosekey; regcreatekeyex; regdeletekey; registerclipboardformat; regopenkeyex; regsetvalueex; release; release_interface; reset; resize; resized; rgb; save; savecompleted; saved; seek; setregkeyvalue; skip; stdentry_; stdmethodimp_; stringfromguid2; succeeded; text; unadvise; unicodeok; unlock; unownthis; writefmtusertypestg; wsprintf