Except to set the dependency of services in SCM(Service Control Manager). You have another way to make sure some services can run before your application (serivce). Use StartService to start a Window Service Please note as follow: If the service already start, it will return FALSE. The function will return if the Windows Service is in running status (maybe needs 30sec atmost) or failed. For more detail, please refer MSDN. Refer the sample code. SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CONNECT); SC_HANDLE service; > > if (serviceControlManager) { service = OpenService(serviceControlManager, "SERVICE_NAME", SERVICE_START | SERVICE_QUERY_STATUS | DELETE); // Make sure you have the privilege of SERVICE_START. > > if (service) { if (StartService(service, 0, NULL)) { // Services already startup successes. } else { DWORD dwLastError = GetLastError(); if (dwLastError == ERROR_SERVICE_ALREADY_RUNNING) { //Services already started } else { //Service can not start. hr = E_FAIL; return; }...
最近由於想架設一個DKP網站,才知道自己主機的MySQL 的版本竟然太舊而無法support unicode的問題(4.1X才有Unicode support, 4.0X都是外面Unicode 而資料庫裡面還是使用iso-8859-1~~)
所以列出一些參考資料
Upgrading from MySQL 4.0 to 4.1
MySQL: Upgrading MySQL 4.0 to 4.1(主要是講解upgrade上面可能遇到的問題)
其實充其量~~ 就是為了一個功能
SET NAMES utf8
乾脆換成FreeBSD算了~~ 反正最近ADSL又改成PPPOE的方式了~~~
找到使用MySQL 4.0X版本的EQDKP的版本(1.30)
繁體中文:簡單架設DKP網站
簡體中文:EQDKP 1.3.0 with ItemStats 中文版
(Picturefrom Amazon)
Sometime you just write code without fully understanding the meaning. Like design pattern, maybe you already know part of them even use them very well. “Head First Design Patterns” is a good book, it use a story to let you know why you must use this pattern (some of us may not know forever).
As this chapter “Singleton pattern”, I have already used it in my code everywhere. But I can not get fully understand why we have to use this, how to use this and how to prevent other this in multiple threading programming.
I list a example fot singleton implementation.
class CSingleton
{
public:
static CSingleton * getInstance();
public:
void f1();
void f2();
void f3();
>
> private:
virtual ~CSingleton();
CSingleton();
>
> private:
static CSingleton *m_uniInstance;
};
>
>