2009年4月23日 星期四

create a new atl project in visual

1. new project --> atl project --> 應用程式設定 --> 伺服程式類型 -- > service (EXE)
(Attributed check box is not selected.)

CServiceModule

1. CServiceModule::ServiceMain

2 CServiceModule::Start

3. CServiceModule::Run


前置處理器設定 in visual

資源 --> 前置處理器定義

2009年4月22日 星期三

link設定 in visual

連結器 --> 一般 --> 其它程式庫目錄
link到的lib所在的目錄

連結器 --> 輸入 --> 其他相依性
link到的lib

compile jni program on windows

c/c++ --> 一般 --> 其它include目錄
C:\Program Files\Java\jdk1.6.0_07\include
C:\Program Files\Java\jdk1.6.0_07\include\win32


c/c++ --> 進階 --> 強制include檔
C:\Program Files\Java\jdk1.6.0_07\include\jni.h

LPTSTR problem

LPTSTR has one of two possible definitions depending on whether you're duing a Unicode build or not

wcslen only works on Unicode strings, so in an ANSI build, LPTSTR and wcslen are incompatible

solution: add UNICODE in preprocessor definations

2009年4月19日 星期日

compile project with ddk

設定:
工具 ---> 選項 --> 專案 --> VC++目錄 --> include檔案
add C:\WinDDK\6001.18000\inc\api

工具 ---> 選項 --> 專案 --> VC++目錄 --> 可執行檔
add C:\WinDDK\6001.18000\bin\x86