bool FarsiteEvent::AllocEvents(long numevents, char *basename, bool ManReset, bool InitState) { if(numevents==NumEvents) return true; FreeEvents(); bool NoErr=true; long i; char Name[128]=""; hEvent=new HANDLE[numevents]; if(hEvent==NULL) return false; for(i=0; i<numevents; i++) { sprintf(Name, "%s_%02ld", basename, i+1); hEvent[i]=CreateEvent(NULL, ManReset, InitState, reinterpret_cast<LPCSTR>(Name)); if(hEvent[i]==NULL) { NoErr=true; break; } NumEvents++; } return NoErr; }
CHandler::~CHandler() { FreeEvents(); // Free m_pConnection m_pAddin->Release(); }
FarsiteEvent::~FarsiteEvent() { FreeEvents(); }