#include "StdAfx.h" #include "Station.h" #ifdef _DEBUG #define new DEBUG_NEW #endif CStation::CStation(LPCTSTR name,int ID) : TObject(TypeIsStation,ID,theNetwork->NetEvents) { Name = NULL; size_t l = _tcslen(name); if(l) { Name = new TCHAR[l+1]; _tcscpy_s(Name, l+1, name); } else { Name = new TCHAR[8]; _tcscpy_s(Name, 8, _T("Unknown")); } Location = 0; Position.x=0; Position.y=0; } CStation::~CStation(void) { if(Name) { delete[] Name; Name = NULL; } }