Jump to content

wpSetAssociationFilter

From EDM2

WPProgram

This instance method is called to set an association of the program object to a data file object based on a file title filter.

Syntax

_wpSetAssociationFilter(somSelf, pszFilter)

Parameters

somSelf (WPProgram *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPProgram.
pszFilter (PSZ) - input
Pointer to file title filters.
A pointer to a string containing file title filters to associate. This string can contain several file title filters separated by a comma; for example:
pszFilter = "*.TXT, *.DOC"

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 title filter.

Remarks

The association filter is used to designate this program as an available **open view** for data file objects that have a title that matches one of the association filters which are set. If a data file object matches a filter 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 **wpSetAssociationFilter** method causes the existing association filters for this object to be **replaced**. To determine the existing association filters that are set on this object, a call to the wpQueryAssociationFilter method can be made. The wpSetAssociationType method can be called to set an association based on the type of 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 pszFilter; /* Pointer to file title filters. */
BOOL rc; /* Success indicator. */

rc = _wpSetAssociationFilter(somSelf, pszFilter);

Related Methods


WPProgramFile

This instance method is called to set an association of the program object to a data file object based on a file title filter.

Syntax

_wpSetAssociationFilter(somSelf, pszFilter)

Parameters

somSelf (WPProgramFile *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPProgramFile.
pszFilter (PSZ) - input
Pointer to file title filters.
A pointer to a string containing file title filters to associate. This string can contain several file title filters separated by a comma; for example:
pszFilter = "*.TXT, *.DOC"

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 title filter.

Remarks

The association filter is used to designate this program as an available **open view** for data file objects that have a title that matches one of the association filters which are set. If a data file object matches a filter 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 **wpSetAssociationFilter** method causes the existing association filters for this object to be **replaced**. To determine the existing association filters that are set on this object, a call to the wpQueryAssociationFilter method can be made. The wpSetAssociationType method can be called to set an association based on the type of 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 pszFilter; /* Pointer to file title filters. */
BOOL rc; /* Success indicator. */

rc = _wpSetAssociationFilter(somSelf, pszFilter);

Related Methods