5.8.3 Implementing the Object Command

The Object command usually appears on the Edit menu. When an end user selects an object and pulls down the Edit menu, the ClassName of the object can appear, followed by the word "Object", indicating that the object can be edited (or played). For example, if you selected an object whose ClassName is MS WordArt, the command will be "MS WordArt Object."

When no object is selected, the command changes to "Object ..." and is dimmed (gray text indicating that the user cannot choose this command). If the object is activated, and the menu command is chosen, the object will be edited, played, or whatever action is desired, based on the choice of the primary verb. For most graphical objects, the verb is edit and, for sound, play.

A client application can implement the ClassName Object command by using the OleActivate function. The second parameter of OleActivate allows the client to specify the verb chosen by the user. The parameter, a UINT, specifies which operation to perform (0 = the primary verb, 1 = the secondary verb, and so on).