Jump to content

wpPrintObject

From EDM2

This instance method is called to print a view of the object.

Syntax

_wpPrintObject(somSelf, pPrintDest, ulReserved)

Parameters

somSelf (WPObject *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPObject.
pPrintDest (PPRINTDEST *) - input
Pointer to print data.
It contains all the parameters required to call **DevPostDeviceModes** and **DevOpenDC**. For more information about **DevPostDeviceModes** and **DevOpenDC**, see the **Presentation Manager Programming Reference**.
ulReserved (ULONG) - input
Reserved value; must be 0.

Returns

rc (BOOL) - returns
Success indicator.
  • TRUE Successful completion.
  • FALSE Error occurred.

How to Override

This method should be overridden in order to modify the print behavior supported by an ancestor class.

Usage

This method can be called at any time in order to print a view of an object.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPObject *somSelf; /* Pointer to the object on which the method is being invoked. */
PPRINTDEST *pPrintDest; /* Pointer to print data. */
ULONG ulReserved; /* Reserved value; must be 0. */
BOOL rc; /* Success indicator. */

rc = _wpPrintObject(somSelf, pPrintDest, ulReserved);

Example Code

In this example, where an object does not support being printed, a beep is generated.

SOM_Scope BOOL SOMLINK myfold_wpPrintObject(MYFOLDER *somSelf,
                                PPRINTDEST pPrintDest,
                                ULONG ulReserved)

{
  MYFOLDERData *somThis = MYFOLDERGetData(somSelf);
  MYFOLDERMethodDebug("MYFOLDER","myfold_wpPrintObject");

  DosBeep(100,500);  /* Beep for half a second (500 milliseconds) */

  return( TRUE );
}

Related Methods