/ * Please use VC to build a 1.5KB program! Is it small? 2005.4.10 by ken * / # include #include #pragma Comment (Linker, "/ Opt: NOWIN98") # pragma Comment (Linker, "/ Entry: Kenmain) // Set the program entry #pragma Comment (Linker," /merge:.data =.text ") // Compound Segment #pragma Comment Linker, "/merge:.rdata =.text") cken {public: cken () {m_pname = _t ("ken"); m_pjob = null;} Virtual ~ cken () {tchar textbuf [512]; if ( m_pjob) WSPRINTF ("% s starts working in% s, but because it is not serious, unemployment!"), getName (), getjob ()); else WSPrintf (TextBuf, _t ("% s I haven't found a job so far! "), GetName ()); MessageBox (NULL, TEXTBUF, NULL, NULL); m_pname = null; m_pjob = null;} lpctstr getname () {return m_pname;} lpctstr getJob () {Return m_pjob } Void setJob (LPCTSTR PNEWJOB) {m_pjob = pnewjob;} cken * Run (); protected: lptstr m_pname; lpctstr m_pjob;}; static lpctstr EMPLOYMENT_AGENCY [] = {_ t ("a computer company"), _ T (" Shenzhen ambly network company "), _T (" Shanghai a certain soft Companies), _ T ("a network cleaning company")}; cken * cken :: run () {systemtime systemtime; tchar textbuf [512]; getLocalTime (& systemTime); WSPrintf (TextBuf, _t ("Today is% D years% D day, the following is the reception of% s. ""), systemtime.wyear, systemtime.wmonth, systemtime.wday, getname (); MessageBox (Null, TextBuf, null, null); for INT NUM = 0; Num
}}}} / * Int apientry, hinstance hinstance, lpstr lpcmdline, int ncmdshow) {delete ((new cken ()) -> run ()); returnograph 0;} * / void kenmain () {Delete ((new cken ()) -> run ()); EXITPROCESS (0);} void * __cdecl operator new (getProcessHeap (), Heap_zero_memory, cb);} void __cdecl Operator Delete (Void * p) {if (p) HeapFree (getProcessHeap (), 0, p); there is also a better example of the address below:
Http://msdn.microsoft.com/msdnmag/issues/01/01/hood/default.aspx