Jump to content

wpclsInitData

From EDM2
Revision as of 22:45, 24 May 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:wpclsInitData}} This class method is called to allow the class object to initialize its instance data. ==Syntax== <PRE> wpclsInitData(somSelf); </PRE> ==Parameters== ;''somSelf'' (M_WPObject *) - input :Pointer to the WPObject class object. ==Returns== There is no return value for this method. ==Remarks== This method is called immediately after the class object is first awakened. When the class object is made dormant, the wpclsUnInitData me...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This class method is called to allow the class object to initialize its instance data.

Syntax

wpclsInitData(somSelf);

Parameters

somSelf (M_WPObject *) - input
Pointer to the WPObject class object.

Returns

There is no return value for this method.

Remarks

This method is called immediately after the class object is first awakened. When the class object is made dormant, the wpclsUnInitData method is called to give the class object the opportunity to deallocate resources allocated during the processing of wpclsInitData.

Usage

This method is generally called only by the system when the class object is awakened. The class object is awakened when the first instance of this class is either awakened or newly created. It is made dormant again when the last instance of this class is made dormant.

How to Override

Any class that has metaclass instance variables should override this method so that those variables are all initially in a known state. It is essential to pass this method onto the parent class object before performing any override processing.

Example Code

This coding example uses wpclsInitData to initialize class data associated with MyDataBase:

SOM_Scope void   SOMLINK MyDataBaseM_wpclsInitData(M_MyDataBase *somSelf)
{
    /* M_MyDataBaseData *somThis = M_MyDataBaseGetData(somSelf); */
    M_MyDataBaseMethodDebug("M_MyDataBase","MyDataBaseM_wpclsInitData");

    hModule = _clsQueryModuleHandle(somSelf);

    _hIcon = WinLoadPointer(HWND_DESKTOP, hModule, ID_WINDOW);

    parent_wpclsInitData(somSelf);
}

Related Methods