Jump to content

wpclsQueryInstanceClass

From EDM2
Revision as of 21:39, 25 May 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:wpclsQueryInstanceClass}} This class method returns the name of a class that this object can become. ==Syntax== _wpclsQueryInstanceClass(somSelf) ==Parameters== ;'''somSelf''' (M_WPFileSystem *) - input :Pointer to the WPFileSystem class object. ;'''pszClass''' (PSZ) - returns :String containing the name of the new class for files of this class. ==Returns== ;'''pszClass''' (PSZ) - returns :String containing the name of the new class for fil...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This class method returns the name of a class that this object can become.

Syntax

_wpclsQueryInstanceClass(somSelf)

Parameters

somSelf (M_WPFileSystem *) - input
Pointer to the WPFileSystem class object.
pszClass (PSZ) - returns
String containing the name of the new class for files of this class.

Returns

pszClass (PSZ) - returns
String containing the name of the new class for files of this class.

Remarks

This method can be called at any time to find out what class an object of this class can become.

How to Override

This method should be overridden in any object class that allows instances of the object class to change to another object class by using the Become page of the Properties notebook of the object.

Usage

This method can be called at any time to find out what class an object of this class can become.

Example Code

Declaration:

#define INCL_WINWORKPLACE
#include <os2.h>

M_WPFileSystem     *somSelf;   /*  Pointer to the WPFileSystem class object. */
PSZ                 pszClass;  /*  String containing the name of the new class for files of this class. */

pszClass = _wpclsQueryInstanceClass(somSelf);

This example shows how 'MyClass' allows instances of 'MyClass' to become plain WPDataFile objects.

SOM_Scope PSZ SOMLINK mcM_wpclsQueryInstanceClass(M_MyClass *self)
{
   /* Allow an instance of MyClass to become a WPDataFile object  */
   return 'WPDataFile';
}

Related Methods