wpQueryAssociatedProgram
Appearance
This method is specific to version 2.1, or higher, of the OS/2 operating system.
This instance method returns the WPProgram or WPProgramFile object that is associated with this data file for the specified view.
Syntax
_wpQueryAssociatedProgram(somSelf, ulView, pulHowMatched, pszMatchString, cbMatchString, pszDefaultType)
Parameters
- somSelf (WPDataFile *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPDataFile.
- ulView (ULONG) - input
- View of the data file whose association is being queried.
- This would normally be the result of a _wpQueryDefaultView(somSelf) call.
- pulHowMatched (PULONG) - input
- Flag indicating the association type.
- Possible values are described in the following list:
- **0** Associated by a program added to the menu page.
- **1** Associated by a match from a name filter.
- **2** Associated by a match of types.
- pszMatchString (PSZ) - input
- Type or name filter.
- If **pulHowMatched** is **0**, the first byte is set to **NULL**.
- cbMatchString (ULONG) - input
- Size of **pszMatchString**.
- pszDefaultType (PSZ) - input
- Default data type.
- Possible values are described in the following list:
- **string** If the data file has no real type, use this as the default type in the search for matches.
- **NULL** If the data file has no real type, do not include the system default type in the search for matches.
- **-1** If the data file has no real type, use the system default type in the search for matches.
Returns
- Class (WPObject *) - returns
- The WPProgram or WPProgramFile object class associated with this data file for the specified view.
- A return value of **NULL** indicates that there is no WPProgram or WPProgramFile object associated for that view.
How to Override
This method must be overriden if your class introduces a new form of association for a range of views not known to the shell.
Example Code
#define INCL_WINWORKPLACE
#include <os2.h>
WPDataFile *somSelf; /* Pointer to the object on which the method is being invoked. */
ULONG ulView; /* View of the data file whose association is being queried. */
PULONG pulHowMatched; /* Flag indicating the association type. */
PSZ pszMatchString; /* Type or name filter. */
ULONG cbMatchString; /* Size of pszMatchString. */
PSZ pszDefaultType; /* Default data type. */
WPObject *Class; /* The WPProgram or WPProgramFile object class associated with this data file for the specified view. */
Class = _wpQueryAssociatedProgram(somSelf,
ulView, pulHowMatched, pszMatchString,
cbMatchString, pszDefaultType);