[ChipChat Tech. Group - 32-bit OS/2 text paging software and Sound Cards. (click here).] [The one place to go in Europe for all OS/2 Warp software. (click here).]

Using that Hammer and Screwdriver- by R. L. Walsh

A Guide to WPObjData

Most people consider the WPObjData class a nuisance, but it is actually one of the handiest WPS utilities available. With it, you can create "settings objects" that will set the properties of other WPS objects dropped on them. It's easy to use and far more powerful than the REXX SysSetObjectData function because it works with any class of object.

As supplied with the WPS Feature Installer (used to install, e.g., Java 1.1.x.), WPObjData is a nuisance because it hijacks your data files. They acquire its "hammer and screwdriver" icon and open their notebooks when double-clicked. Many users eliminate this annoyance by simply deregistering the class, then rebooting. Everything, including the Feature Installer, continues to work properly.

However, you can fix this bug in WPObjData and put it to work for you by making a simple change in the dll containing the class (x:\OS2\DLL\OBJDATA.DLL). This change will associate the class with files whose .TYPE is "ObjectData", rather than "Plain Text".

  1. deregister the class, if necessary (use this REXX script)
  2. make a backup copy of OBJDATA.DLL
  3. load the original file into a binary (hex) editor
  4. search for the phrase "Plain Text" (it should occur only once)
  5. replace it with "ObjectData"
  6. save the file
  7. reregister the class (use this REXX script, if necessary)

To create a WPObjData object, open your Templates folder and look for the one with the "hammer and screwdriver" icon. It is probably titled "Data File:1". Drag a copy to the Desktop to create a new object that is actually an empty file of .TYPE "ObjectData". Associate your favorite text editor with this type to make it the default editor.

To set up a WPObjData object, open it in a text editor. Enter WPS setup strings, one per line, then save the file. For example, this sets a folder's default view to Icon and causes it to show all objects in Tree view:


Click here for a complete listing of setup strings for common object classes, along with a list of the values used to select an object's default view.

To use a WPObjData object, drop another object on it. The setup strings that are recognized by the dropped object's class will be used and those properties set. Strings that are meaningless to the object will be ignored.

When using WPObjData, there are a few things you should be aware of:

  1. New properties for files and folders aren't saved automatically. You will have to open and close the object's notebook to do so. Include this setup string to have the object open its notebook when you set its properties: OPEN=DEFAULT
  2. In most cases, you cannot use a shadow to set the properties of an object -- you must use the original.
  3. If you use the WPS to copy one of these objects, the icons on all of your other WPObjData objects will disappear until you reboot. This is a bug in the WPS.

The information contained in this article is largely the result of experimentation. There may be some inaccuracies, and future releases of the Feature Installer may change WPObjData's operation. Readers' corrections and updates will be appreciated.

* * *

Rich Walsh is a freelance programmer and author of the several utilities, including DragText.


[Our Sponsor: Indelible Blue - OS/2 software and hardware solutions to customers worldwide.]

Copyright © 1998 - Falcon Networking ISSN 1203-5696