Jump to content

wpclsQueryInstanceType

From EDM2

This method is called to allow the class object to specify the file types for instances of its class.

Syntax

_wpclsQueryInstanceType(somSelf)

Parameters

somSelf (M_WPFileSystem *) - input
Pointer to the WPFileSystem class object.
psuccess (PSZ) - returns
Success indicator. NULL Error occurred. Other A pointer to a string containing file types. This string can contain several file types separated by commas. For example: 'Plain Text,C Code'.

Returns

psuccess (PSZ) - returns
Success indicator. NULL Error occurred. Other A pointer to a string containing file types. This string can contain several file types separated by commas. For example: 'Plain Text,C Code'.

Remarks

It is recommended that object classes define their own special type strings.

How to Override

This method should be overridden in order to automatically designate file objects as instances of this class. The value returned by the override method will replace the current type string which is used to designate instances. If the parent method is called, it should be called first.

Usage

This method can be called at any time in order to determine which file types are used to determine instances of this class.

Example Code

Declaration:

#define INCL_WINWORKPLACE
#include <os2.h>

M_WPFileSystem     *somSelf;   /*  Pointer to the WPFileSystem class object. */
PSZ                 psuccess;  /*  Success indicator. */

psuccess = _wpclsQueryInstanceType(somSelf);

This example associates two file types as being associated with the Picture object.

SOM_Scope PSZ   SOMLINK PictureM_wpclsQueryInstanceType(M_Picture *somSelf)
{
    /* M_PictureData *somThis = M_PictureGetData(somSelf); */
    M_PictureMethodDebug('M_Picture','PictureM_wpclsQueryInstanceType');

/*  return (parent_wpclsQueryInstanceType(somSelf));  no call to parent */

    return ( 'JPG File,GIF File' );
}

Related Methods