Object Registration

When the user double clicks the mouse on a data file icon in the Workplace Shell, a window opens up to display its default view. To do this, the system has to invoke a program and pass the file name to that program as a parameter. This requires the system to know which application (or object handler) to invoke, and where it is stored.

In the File Manager under OS/2 Version 1.3, the services which performed this function were hidden and not available to applications. In OS/2 Version 2.0, however, they are exposed and accessible through the Workplace Shell. There are three elements to this: program registration, file registration and file association.

When an application is installed under the Workplace Shell, a program template is used to register the application as an instance of the WPProgram class (a subclass of WPAbstract). This makes the program a persistent object.

The program reference information and icon are stored in the OS2.INI file. The icon is displayed in a specified folder, and a default view is defined. After registration this icon can be dragged and dropped on other WPS objects, such as a folder or the shredder.

Data files are also registered with the WPS, which creates new instances of the WPDataFile class for them. The file is stored in a directory and its "settings" information is stored in EAs attached to the file.

When you make a shadow copy of a file, the WPS creates an instance of the WPShadow class and stores it in the OS2.INI file. For this shadow, as with programs and files, using WPS facilities to create a new instance automatically registers it with the WPS.


[Back: Workplace Shell Facilities]
[Next: File Associations]