To support printing the contents of an object from the Desktop-by using the object's pop-up menus or dragging the object and dropping it on the printer object-the object's class definition must override wpPrintObject inherited from its parent class.
The new class is created as a subclass of an existing class. For example, if the object is to be a data file, the WPDataFile class would be used as the parent class. In the class definition file, the new class overrides wpPrintObject that it inherits from its parent class. The new class' version of wpPrintObject contains the code that prints the contents of the object.
Note: It is recommended that the code in the object's version of wpPrintObject should start on a separate thread to execute the code that actually prints the contents of the object. By doing this, the control can be returned to the Workplace Shell and the user immediately. Supporting code, such as dialog windows, should be done on a separate thread as well.
Your new class should allow data files that do not belong to your class to be printed as well. To do this, you should also override wpclsQueryInstanceType and wpclsQueryInstanceFilter to verify if a file is yours (that is, if its .TYPE extended attribute denotes your new class), or if it is not yours. If the file is not yours, you will want to call parent_wpPrintObject to do the printing.