Jump to content

wpSetType

From EDM2

This instance method is called to allow the object to change the type of its file.

Syntax

_wpSetType(somSelf, pszTypes, pfeal)

Parameters

somSelf (WPFileSystem *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPFileSystem.
pszTypes (PSZ) - input
Pointer to buffer containing type to set.
This string can contain a list of types delineated by a line-feed character; for example,
 psztypes="Plain Text\nC code"
pfeal (PFEA2LIST *) - input
Reserved - must be set to 0.

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 the type on the file object.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPFileSystem *somSelf; /* Pointer to the object on which the method is being invoked. */
PSZ pszTypes; /* Pointer to buffer containing type to set. */
PFEA2LIST *pfeal; /* Reserved - must be set to 0. */
BOOL rc; /* Success indicator. */

rc = _wpSetType(somSelf, pszTypes, pfeal);

Remarks

This method will cause the file's .TYPE extended attribute to be set.

Example Code

This example initializes the type of the instance of the Browse_O_Matic object to DLL.

SOM_Scope BOOL SOMLINK Browse_O_Maticwps_wpSetup(Browse_O_Matic *somSelf,
                PSZ pszSetupString)
{
  /* Browse_O_MaticData *somThis = Browse_O_MaticGetData(somSelf); */
  Browse_O_MaticMethodDebug("Browse_O_Matic","Browse_O_Maticwps_wpSetup");

  _wpSetType( somSelf, DRT_DLL, NULL);

  /************************************************/
  /* Allow mulitple secondary views of the object */
  /************************************************/

  _wpSetConcurrentView( somSelf, CCVIEW_ON);

  return (parent_wpSetup(somSelf,pszSetupString));
}