Monthly Archives: January 2006

想吃甜品

今天中午很想吃甜的东西,家里的巧克力在深深地诱惑我,我走到离它不远的地方停住了,哎,忘了买一个秤回家,我好像胖了,运动太少,今天还是不吃了。把剩下的开心果消灭了。 对肉没有胃口,昨天吃了一块咸鱼。 Advertisements

Posted in Uncategorized | Leave a comment

novel

I spent 3 days reading the novel 亡天,我自己的神话, which is published at http://www.plsd.net/book_read/htm/bid_7242.htm

Posted in Uncategorized | Leave a comment

read formated data from cin

the following code snippet was created by Onega. built on cygwin.  g++ tmp_1.cpp -o a.exe #include <iostream> #include <cmath> using namespace std; double read_double(const char* prompt) {   double dret = 0;   do{     cout<<prompt<<endl;     cin>>dret; … Continue reading

Posted in Uncategorized | Leave a comment

cppunit unicode configuration build error

win32dynamiclibrarymanager.cpp(57) : error C2440: ‘initializing’ : cannot convert from ‘LPCTSTR’ to ‘std::basic_string<_Elem,_Traits,_Ax>’ My fix:#include <cppunit/Portability.h> #if defined(CPPUNIT_HAVE_WIN32_DLL_LOADER) #include <cppunit/plugin/DynamicLibraryManager.h> #define WIN32_LEAN_AND_MEAN #define NOGDI //#define NOUSER  //Onega: comment out it for comutil.h #define NOKERNEL #define NOSOUND #define NOMINMAX #include <windows.h> #include … Continue reading

Posted in Uncategorized | Leave a comment

config ATL service project to auto start

    bool auto_start_service()    {        SC_HANDLE schSCManager = NULL;        schSCManager = OpenSCManager(            NULL,            NULL,            SC_MANAGER_ALL_ACCESS);        if (schSCManager == NULL)        {            SC_TRACE(_T("Failed to open SCManager"));            return false;        … Continue reading

Posted in Uncategorized | Leave a comment

register service as autostart in ATL7.1 service project

add a method to CAtlServiceModuleT derived class    BOOL Install() throw()    {//install auto start service.        if (IsInstalled())            return TRUE;         // Get the executable file path        TCHAR szFilePath[MAX_PATH + _ATL_QUOTES_SPACE];        DWORD dwFLen = ::GetModuleFileName(NULL, szFilePath … Continue reading

Posted in Uncategorized | Leave a comment

auto link header for VC++

//The following header file is created by Onega //*********need to set this library name****************#define CPPUNIT_PROJ_NAME "cppunit_1_10_2" #if _MSC_VER == 1400  //v6.0 #define CPPUNIT_VC_NAME  "_VC80" #endif #if _MSC_VER == 1310 #define CPPUNIT_VC_NAME  "_VC71" #endif #if _MSC_VER == 1200  //v6.0 #define CPPUNIT_VC_NAME  … Continue reading

Posted in Uncategorized | Leave a comment