“Windows Service” and “Registry key”

There are something we should keep in mind when we tried to write a Windows Service. The most important is the “Registry Key”. In Windows programming, we usually use registry key to setting some value for difference user. Regstry key control become more and more in your code, and we also usually  read the specific user in “HKEY_CURRENT_USER” **first then open generic “HKEY_LOCAL_MACHINE” .** Here comes the problem, According this article(Services and the Registry) in MSDN. We should not use “HKEY_CURRENT_USER” **to retrival current user’s registry key value. Because Windows Services always startup before user login. It may happen some error or loading the wrong setting profile. If you still insist on using the current user registry key setting, please refer ”RegOpenCurrentUser”. In my experience use “RegQueryValueEx” with “HKEY_CURRENT_USER”** will retrival the RootUser’s setting. It make me confuse. So the better way the use registry key in Windows Service is handle the...
繼續閱讀

A Quick note to “Windows Service”

A simple note from “Write Pure Windows Service” and “How to debug Windows Service”. Write “Windows Service” Windows Service is kind of application but it will start when system startup. Windows service will triggerd by “SMC”(System Managed Controller). There is some important note from my writing windows service experience. **Register your service: **What ever your application is big or small. You must register them to SMC before you use it. Please reference ::OpenSCManager() and ::CreateService(). For more detail please reference Writing a Service Program’s main Function Start a “Windows Service”. You can not startup a windows service via any debugger, you need to startup it on SMC. The SMC will use ::StartServiceCtrlDispatcher to start service and wait for the call back signal “SERVICE_RUNNING”. If you can not startup windows service normally, please let the Service_Status call back and tried to figurate out the root cause. For more detail please refer...
繼續閱讀

本站開始檔blogspot的留言

由於來自於blogspot.com的廣告實在太多,不知道是不是她們自己的問題,還是廣告商的利害~~ 決定要檔這整個網域的留言~~~ 若是從這些網站來的~~ 請加上空白
繼續閱讀

勇者鬥惡龍~ 裝備篇

之前去日本北海道的時候,去電玩賣場的玩具部看到的。雖然沒有買到羅德系列的裝備~~ 但是卻也買了兩個很漂亮的武器~~  
繼續閱讀

Resolve some build error in VS2005

**Remove DirectX SDK **Because VS2005 doesn’t need DirectX SDK, so ~~~ if you use some library from DirectX. Please use #if (defined(_MSC_VER) && (_MSC_VER > 1310)) //For VS2005 Compiler ///….. #endif Which the version of compiler VS2003 is 1310, and VS2005 is 1400. **Resolve “ambiguous symbol” build error from IXMLDOMElementPtr **From Microsoft PRB 316317(PRB: Compiler Errors When You Use #import with XML in Visual C++ .NET) and 26914(PRB: Compiler Errors When You Use #import with XML) . We may use more precise directory path to import msxml.dll, such like import “C:MSXMLmsxml.dll”. Also refer Belarce’s post on CodeGuru. You can download the old version msxml.h and include it before you import
繼續閱讀

青年首次購屋貸款

(資料來源:  蘋果日報網路) 最近察到資料~~~ 資格 青年購屋低利貸款申請人應符合下列條件: (一)年滿20歲以上至40歲之間,在當地設有戶籍者。 (二)與直系親屬設籍於同一戶或有配偶者。 (三)本人、配偶、戶籍內之直系親屬及其配偶均無自有住宅。 (四)家庭年收入在戶數20%分位點以下者。 (五)本人、配偶、戶籍內之直系親屬及其配偶均未曾受政府輔助購(建)住宅者。 申辦手續(傑森 > 部落格 > 生活雜記 > 青年首購貸款 ) 申請書一份 戶口名簿影本或戶籍謄本一份 切結書一份 本人、配偶、戶籍內之直系親屬及其配偶之歸戶財產查詢清單 貼足雙掛號郵資之回郵信封(所填地址須為白天有人收信之地址)。
繼續閱讀