This example initializes state variables and allocates any extra memory that might be needed.
SOM_Scope void SOMLINK myf_wpInitData(MYFILE *somSelf) { MYFILEData *somThis = MYFILEGetData(somSelf); MYFILEMethodDebug("MYFILE","myf_wpInitData"); parent_wpInitData(somSelf); /* Have parent method do initialization */ _pszLastWorker = (PSZ) _wpAllocMem(somSelf, CCHMAXPATH+1, /* Number of bytes */ NULL); /* Return error message */ if (_pszLastWorker) { strcpy(_pszLastWorker, DEFAULT_LASTWORKER); } /* endif */ }