wpSetAssociationType
WPProgram
This instance method is called to set an association of the program object to a data file object based on a file type.
Syntax
_wpSetAssociationType(somSelf, pszType)
Parameters
- somSelf (WPProgram *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPProgram.
- pszType (PSZ) - input
- Pointer to file types.
- A pointer to a string containing file types to associate. This string can contain several file types separated by a comma; for example:
pszType = "Plain Text,C Code"
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE Successful completion.
- FALSE Error occurred.
How to Override
This method is generally not overridden.
Usage
This method can be called at any time in order to set an association of the program object to a data file object based on a file type.
Remarks
The association type is used to designate this program as an available **open view** for data file objects that have a type that matches one of the association types which are set. If a data file object matches a type in a program object or program file object, the title of the program object or program file object appears in the data file object's Open cascade of its pop-up menu.
A call to the **wpSetAssociationType** method causes the existing association types for this object to be **replaced**. To determine the existing association types that are set on this object, a call to the wpQueryAssociationType method can be made. The wpSetAssociationFilter method can be called to set an association based on the title of the data file object.
Example Code
#define INCL_WINWORKPLACE #include <os2.h> WPProgram *somSelf; /* Pointer to the object on which the method is being invoked. */ PSZ pszType; /* Pointer to file types. */ BOOL rc; /* Success indicator. */ rc = _wpSetAssociationType(somSelf, pszType);
Related Methods
- wpQueryAssociationType (WPProgram)
- wpQueryAssociationType (WPProgramFile)
- wpSetAssociationType (WPProgramFile)
WPProgramFile
This instance method is called to set an association of the program object to a data file object based on a file type.
Syntax
_wpSetAssociationType(somSelf, pszType)
Parameters
- somSelf (WPProgramFile *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPProgramFile.
- pszType (PSZ) - input
- Pointer to file types.
- A pointer to a string containing file types to associate. This string can contain several file types separated by a comma; for example:
pszType = "Plain Text,C Code"
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE Successful completion.
- FALSE Error occurred.
How to Override
This method is generally not overridden.
Usage
This method can be called at any time in order to set an association of the program object to a data file object based on a file type.
Remarks
The association type is used to designate this program as an available **open view** for data file objects that have a type that matches one of the association types which are set. If a data file object matches a type in a program object or program file object, the title of the program object or program file object appears in the data file object's Open cascade of its pop-up menu.
A call to the **wpSetAssociationType** method causes the existing association types for this object to be **replaced**. To determine the existing association types that are set on this object, a call to the wpQueryAssociationType method can be made. The wpSetAssociationFilter method can be called to set an association based on the title of the data file object.
Example Code
#define INCL_WINWORKPLACE #include <os2.h> WPProgramFile *somSelf; /* Pointer to the object on which the method is being invoked. */ PSZ pszType; /* Pointer to file types. */ BOOL rc; /* Success indicator. */ rc = _wpSetAssociationType(somSelf, pszType);
Related Methods
- wpQueryAssociationType (WPProgram)
- wpQueryAssociationType (WPProgramFile)
- wpSetAssociationType (WPProgram)