2013年12月25日 星期三

lubuntu手動升級

不知道為什麼軟體升級圖形介面都開不起來
用下面指令手動更新
do-release-upgrade -d

Ubuntu增加user至group


  1. useradd username   //新增user
  2. useradd -g groupname username   //新增user至群組
  3. groupadd groupname  //新增群組
  4. usermod -a -G groupname username   //將user增加至群組

2013年12月19日 星期四

將project從Ubuntu搬到Debian, compiler出現libc.so.6: version `GLIBC_2.14' not found錯誤

因為使用的lubuntu環境都有些小bugs
更到最新版可已解決但是又會出現其他bugs
聽說Debian比較穩定, 決定搬家 ^^

把資料直接搬移到Debian, 結果compiler出現問題, 暈~~~
出現下面的錯誤:
libc.so.6: version `GLIBC_2.14' not found
在想說是不是該手動搬glibc-2.14.tar.xz來,
還好Make clean之後再Make就解決了 ^^
看來是兩個環境使用的系統不一樣, 需要重新compiler

2013年12月16日 星期一

lubuntu 13.10不能夠autostart APP

  1. 開啟Start Menu/Preferences/Default applications for LXSession
  2. 到autostart頁面設定Disable autostarted applications為no
  3. 沒有看到Default applications for LXSession, 可先自行安裝lxsession-default-apps
或是
  1. 修改desktop.conf
  2. #disable_autostart=config-only
  3. disable_autostart=no
可在Desktop Session Settings設定要autostart的APP
或在
autostart file內添加自動啟動程式

2013年12月3日 星期二

搬移ubuntu home目錄至另一顆硬碟

  1. cfdisk /dev/sdb                    //建立partition
  2. mkfs.ext4 /dev/sdb1          //format為ext4格式  
  3. mkdir /media/tmp
  4. mount /dev/sdb1 /media/tmp
  5. rsync -avx /home /media/tmp
  6. mount /dev/sdb1 /home
  7. ls -l /home                            //確認是否成功
  8. umount /home
  9. umount /media/tmp
  10. rm -r /media/tmp
  11. rm -rf /home/*
建立自動掛載
#blkid
/dev/sda1: UUID="bba98b54-13c4-49fc-bdb8-998d0d771844" TYPE="ext4"
/dev/sda5: UUID="0ef50f74-032e-4790-bd7b-8e19e770f7ea" TYPE="swap"
/dev/sdb1: UUID="e71eed4f-2188-4f33-a5e1-d76b7e6084f4" TYPE="ext4"

#leafpad /etc/fstab
增加
UUID=e71eed4f-2188-4f33-a5e1-d76b7e6084f4    /home    ext4    defaults    0    2

2013年12月1日 星期日

Achieve Silverlight UI 1

安裝環境設置
1. 安裝 Microsoft Visual Studio 2005.
2. 安裝 Windows Embedded CE 6.0.
3. 安裝 Microsoft Visual Studio 2005 Service pack 1.
4. 安裝 Microsoft Visual Studio 2005 Service pack 1 for Vista (Vista System).
5. 安裝 Windows Embedded CE 6.0 Service pack 1.
6. 安裝 Windows Embedded CE 6.0 R2.
7. 安裝 Windows Embedded CE 6.0 R3.
建置可執行 Silverlight UI Emulator OS
1. 新增 Windows CE project.

2.      選擇 Device Emulator BSP.
3. 選擇所需的 components.
·         選擇 PDA Device for Web Pad type.
·         移除不需要的 components 以增加建造速度.
·         完成 project 的建造.
4. 增加執行 Silverlight UI 所需的 components.
·         須增加 Silverlight for Windows Embedded Image Decoder components.
·         Silverlight for Windows Embedded 為了解讀 XAML 檔案並執行 Silverlight.
·         Image Decoder decode 並協助顯示顯示 Silverlight 所需的圖片.
·         輸入 XAML 搜尋 component.
·         增加 Silverlight for Windows Embedded Image Decoder components.

5. 設置 project 環境.
·         選擇 project Properties 進入設定選單.

·         使用 Release 版本的 OS.

·         支援大於 64 MB 的記憶體.

6. 建置 OS.
·         選擇建置 Release 版本.

·         第一次建置, 使用 Rebuild.

7. Download Emulator.
·         進入 Emulator 設定選單, 並設置為 640 X 480  的解析度.

·         Download OS.

·         看到 OS 畫面.


WinCE6.0 Use Silverlight build up UI

1.      Build up WinCE 6.0 with Silverlight runtime.
2.      Prepare a Silverlight project.
Refer attached files, Achieve SilverlightUI 1.
3.      Silverlight coding steps.
·         XAML runtime initial.
bIsXRInitialized = XamlRuntimeInitialize();
if (!bIsXRInitialized)
 return FALSE;
·         Get application instance.
hResult = GetXRApplicationInstance(&pApplication);
if(FAILED(hResult))
{
RETAILMSG(MSG_FLAG, (TEXT("XAML: GetXRApplicationInstance %x error."), hResult));
return FALSE;
}
·         Add resource.
hResult = pApplication->AddResourceModule(hInstance);
if(FAILED(hResult))
{
RETAILMSG(MSG_FLAG, (TEXT("XAML: AddResourceModule %x error."), hResult));
return FALSE;
}
·         Set XAML.
//
直接指定 XAML file 路徑
// cSourceXaml.SetFile(TEXT("\\Windows\\Page.xaml"));
//
XAML file 加入 resource , 可用此方式
cSourceXaml.SetResource(hInstance, TEXT("XAML"), MAKEINTRESOURCE(IDR_XAML1));
·         Set Silverlight window.
XRWindowCreateParams WindowParameters;
ZeroMemory(&WindowParameters, sizeof(WindowParameters));
WindowParameters.Style = WS_CAPTION | WS_SYSMENU;
WindowParameters.pTitle = TEXT("Silverlight Sample UI");
WindowParameters.Left = 0;
WindowParameters.Top = 0;
·         Get visual host.
hResult = pApplication->CreateHostFromXaml(&cSourceXaml, &WindowParameters, &pVisualHost);
if(FAILED(hResult))
{
RETAILMSG(MSG_FLAG, (TEXT("XAML: CreateHostFromXaml %x error."), hResult));
return FALSE;
}
·         Get root.
pVisualHost->GetRootElement(&pRootElement);
·         Get window handle but dialog don't need this.
pVisualHost->GetContainerHWND(&hwnd);
·         Add image mouse down handle.
// I1
XAML 圖形元件名稱, 透由 find name 找出其 handle.
pRootElement->FindName(TEXT("I1"), &pImg);
pImg->AddMouseLeftButtonDownEventHandler((IXRDelegate<XRMouseButtonEventArgs> *)
CreateDelegate(this, &MySilverlight::OnMouseLeftButtonDownEventHandler));
·         Mouse down handle implementation.
class MySilverlight
{
// Mouse enter event handler
HRESULT OnMouseLeftButtonDownEventHandler(IXRDependencyObject *pSender,
XRMouseButtonEventArgs *pArgs)
{
if(!bFocus)
{
// to do your code
}
else
{
// to do your code
}
}
}

·         Run Silverlight.
#if 0
// Use dialog
hResult = pVisualHost->StartDialog(NULL);
if(FAILED(hResult))
{
RETAILMSG(MSG_FLAG, (TEXT("XAML: StartDialog %x error."), hResult));
return FALSE;
}
#endif
// Use window
pVisualHost->ShowWindow();
UpdateWindow(hwnd);
// Start processing
pApplication->StartProcessing(&exitCode);
Refer attached files, Achieve Silverlight UI 2.

2013年11月29日 星期五

Linux分割與合併文件

split -b ???m ???.tar.bz2 ???_split.tar.bz2.
cat ???_split.tar.bz2.a* > ???.tar.bz

lubuntu使用WebDAV連接至box使用雲端空間

Google了很久,終於找到方法了

  1. apt-get install davfs2
  2. echo “https://dav.box.com/dav username password” >> /etc/davfs2/secrets
  3. mkdir ~/Box
  4. mount -t davfs https://dav.box.com/dav ~/Box
可以寫成bash檔放在/etc/profile.d底下來自動mount
#!/bin/bash
mount -t davfs https://dav.box.com/dav /root/Box

2013年11月28日 星期四

用Thunderbird+DavMail替代Office Outlook 2010

Outlook 2010開啟實在太慢,整個系統都變慢,而且有時會好像當掉一樣,一直連網等待,甚
至有時候還不允許某些動作離線工作 ><
決定換掉了~~~

安裝Thunderbird
下載安裝DavMail

開啟DavMail設定,
輸入OWA URL,https://exchangeServer/exchange/ (替代為公司的exchange server)

開啟Thunderbird
新增郵件帳號

  1. 選擇POP3/SMTP
  2. server host name: localhost
  3. port: 參考DavMail
  4. username: domain\username

安裝通訊錄

  1. 新增LDAP目錄
  2. hostname: localhost
  3. base DN: ou=people
  4. port: 參考DavMail
  5. bind DN: domain\username

新增行事曆
從add-ons增加Lightning
新增行事曆
選擇on the Network
選擇CalDAV
location: http://localhost:1080/users/mail@company.com/calendar

2013年11月21日 星期四

2013年11月20日 星期三

WinCE Unalignment

參考底下範例:
#pragma pack(1)
typedef struct
{
CHAR syncbytes[7];
ULONG imgaddr;
ULONG imglen;
} IMGHDR, *PIMGHDR;
//unaligned
typedef UNALIGNED IMGHDR unlIMGHDR;
typedef UNALIGNED PIMGHDR unlPIMGHDR;

WinCE Set Build File Target Path

增加 “RELEASETYPE=PLATFORM” to sources file 即可。

Linux update image from tftp

#!/bin/sh
SERVER=X.X.X.X
tftp -gr xxx_Image $SERVER
mtd_write –r write /tmp/xxx_Image /dev/mtdx

Linux pppd use 3G

pppd call 3G

Linux確認USB Status

  1. lsusb                                   /*check usb id*/
  2. cd /sys/bus/usb/drivers/usb/usb2/2-2/power
    echo "suspend" > level      /*setting usb noauto*/
  3. ls -la /dev/ttyUSB*            /*check any modem enable*/

累人的檔案格式

        最近工作需要使用Linux,但又離不開windows(因為Exchange與Office關係),
想讓檔案能在Windows與Linux都能編輯與觀看。
        當然最先想到的是HTML,不過HTML最為閱讀來說,不太適合,接下來當然是
PDF,PDF蠻適合閱讀,不過要找到一個好用又免費的PDF Editor真難。
        使用Open Office格式odt,Libreoffice可以編輯,但Microsoft Office打不開,暈 @@
使用docx,在Libreoffice又怪怪的,最後用doc,算是比較正常的。
        只是檔案想要跨平台,有這麼難嗎 ><

Windows安裝Microsoft Office
Linux安裝Libreoffice
ios與Android安裝Quickoffice
Google Driver與Box等雲端都可瀏覽Word檔
格式使用舊版office格式,Microsoft Word 97/2000/xp/2003 doc格式。

P.S. 為了不造成使用困擾,以後決定都用舊版格式了 @@

許我一個跨平台的檔案格式吧!!!

2013年11月19日 星期二

安裝Android開發環境

參考Initializing a Build Environment

  1. Python 2.6 -- 2.7
  2. GNU Make 3.81 -- 3.82
  3. JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older
  4. Git 1.7 or newer
  • #apt-get install python
  • #apt-get install make
  • Ubuntu Java help
    #wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin
    #chmod u+x jdk-6u45-linux-x64.bin
    #./jdk-6u45-linux-x64.bin
    #mv jdk1.6.0_45 /opt
    #update-alternatives --install "/usr/bin/jar" "jar" "/opt/jdk1.6.0_45/bin/jar" 1
    #update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.6.0_45/bin/java" 1
    #update-alternatives --install "/usr/bin/javac" "javac" "/opt/jdk1.6.0_45/bin/javac" 1
    #update-alternatives --install "/usr/bin/javadoc" "javadoc" "/opt/jdk1.6.0_45/bin/javadoc" 1
    #update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/opt/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so" 1
    #update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/jdk1.6.0_45/bin/javaws" 1
    #update-alternatives --config jar
    #update-alternatives --config java
    #update-alternatives --config javac
    #update-alternatives --config javadoc
    #export _JAVA_HOME=/opt/jdk1.6.0_45/
  • #apt-get install gcc-4.4 g++-4.4 gcc-4.4-multilib g++-4.4-multilib
  • #cd /usr/bin
    #rm –f gcc; ln –s gcc-4.4 gcc
    #rm –f g++; ln –s g++-4.4 g++
  • #apt-get install git git-core gnupg flex bison gperf build-essential zip curl libc6-dev lib32ncurses5-dev libncurses5-dev:i386 ia32-libs x11proto-core-dev libx11-dev libx11-dev:i386 lib32readline5-dev libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev zlib1g-dev:i386
  • #ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so (Ubuntu-10.10)

2013年11月14日 星期四

Android WLAN連線方式

  1. ./wpa_supplicant -Dwext -iwlan0 -c wpa_supplicant.conf -d
  2. 搜尋AP
    iwlist wlan0 scan
  3. 連線至AP
    iwconfig wlan0 essid "APSSID"

Android 3G Dongle PPP撥號測試

使用.chat文件來撥號

TIMEOUT 10
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'ERROR'
SAY 'Starting GPRS connect script\n'
""'ATZ'
SAY 'Setting APN\n'
OK 'AT+CGDCONT=1,"IP","internet"'
ABORT 'NO CARRIER'
SAY 'Dialing...\n'
OK 'ATD*99***1#'
CONNECT

Compiler出現fatal error: zlib.h & lzma.h : No such file or directory錯誤

  1. apt-cache search liblzma
  2. apt-get install liblzma-dev

編譯時產生error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments錯誤

int fd = ::open(strPersistFile.c_str(), O_WRONLY | O_CREAT | O_TRUNC, XXXX);
加上權限即可

x64編譯x32出現問題

apt-get install gcc-multilib

這個可用於x86與x64間的編譯

Compiler發生cannot find crti.o: No such file or directory

x64,
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH
export LIBRARY_PATH
x32,
LIBRARY_PATH=/usr/lib32:$LIBRARY_PATH
export LIBRARY_PATH

移除lubuntu訪客帳號

  1. vi /etc/lightdm/lightdm.conf
  2. 增加一行,allow-guest=false
  3. lightdm restart

lubuntu Firefox Adobe Flash硬體加速設定

新增/etc/adobe/mms.cfg

EnableLinuxHWVideoDecode=true或是EnableLinuxHWVideoDecode=false
另有override GPU參數OverrideGPUValidation=true or false

Modem Commands

Modem Commands

lubuntu解壓縮RAR壓縮檔

  1. apt-get install rar
  2. rar e XXX.rar

lubuntu Big5與UTF-8轉換

iconv -f BIG5 -t UTF8 [inputfile] -o [outputfile]

CyanogenMod ROM

    CyanogenMod好像release手機ROM耶,我的Xperia V一直沒有升級的ROM,是不是該來刷CyanogenMod ROM看看,來支援Android 4.2 ><

2013年10月25日 星期五

WinCE如何使用Platform Builder Debug

參考以下步驟,
  1. Building Debug版的OS Image
    • 從"Platform"選單選擇"Settings" 
    • 在"Settings" dialog選擇"debug configuration" 
    • 在"Build Options" table勾選"Enable Kernel Debugger" 
  2. 連結PC與Target device 
    • 於PC設定static IP 
    • 於Target device eboot選單中,設定static IP,讓PC與Target device於同一網域內
      或 
    • PC連接至DHCP server 
    • Targe device設為DHCP模式,皆由DHCP獲得IP 
  3. 設定Download and Debugging方式 
    • 從"Target"選單選擇"Configure Remote Connection" 
    • 於"Download Service"選擇"Ethernet" 
    • 於"Kernel Transport"選擇"Ethernet" 
    • 打開Target device進入download模式 
    • 按下"Configure"按鈕,等到收到"Device ID"後,選擇此ID 
  4. Platform Builder顯示download進度 
  5. Platform Builder於debug window顯示booting message 
  6. 使用"Debug" tool進行debug

WinCE4.2 Loadcepc Floppy can't detect C:

建立win98開機片,並從loadcepc磁片複製"AUTOEXEC.BAT"、"CONFIG.SYS"及"HIMEM.SYS"到win98開機片,成為新的loadcepc磁片。

輸入Windows Embedded CE PID

依照下列步驟,
  1. 開啟Platform Builder 
  2. 於"File"選單下選擇"License Binary Image" 
  3. 輸入25字的PID 
  4. 按下"Stamp Binary"按鈕,完成PID的輸入

WinCE ignore Build Warning Message

使用compiler option - /W,/w來設定 Warning Level。

Warning Level
Description
/w
Turns off all warning messages. Use this option when you compile programs that deliberately include questionable statements. The /w option applies to the remainder of the command line, or applies until the next occurrence of a /w option on the command line. /W and /W0 are the same as /w.
/W1
Default. Displays severe warning messages.
/W2
Displays an intermediate level of warning messages. Level 2 includes warnings such as the following: 
  • Use of functions with no declared return type 
  • Failure to put return statements in functions with non-void return types 
  • Data conversions that would cause loss of data or precision
/W3
Displays a less severe level of warning messages, including warnings about function calls that precede their function prototypes in the source code.
/W4
Displays the least severe level of warning messages, including warnings about the use of non-ANSI features and extended keywords.
/WX
Treats all warnings as errors. If there are any warning messages, the compiler generates an error message, and continues compilation.

CL environment variable – 
SET CL=[[ [[option]] ... [[file]] ...]] [[/link [[ link-libinfo]] ]]
CLxxx [[option...]] file... [[option | file]]... [[lib...]]
[[/link link-opt...]][[@response-file]]
Argument
Description
Option
One or more compiler options.
  • All options apply to all specified source files.
File
Specifies the name of one or more source files, object files, or libraries. You must specify at least one file name. The compiler compiles the source files and passes the names of the object files and libraries to the linker.
Lib
Specifies one or more library names. The compiler passes the names of these libraries to the linker for processing.
Link-opt
Specifies one or more of the linker options. The compiler command passes these options to the linker for processing.
Response-file
Specifies a response file that can contain multiple options and file names that you would otherwise type on the command line or specify by using the CL environment variable.

在WinCE6.0上使用MFC

WinCE6.0轉支援ATL8移除了MFC component。
我們可利用下列方式讓WinCE6.0支援MFC。
  1. 將所有MFC的DLL檔案包到OS Image
    • DLL來源位置:$(_SystemRoot)\Program Files\Microsoft Visual Studio 8\VC\ce\DLL\Platform
    • 將其包進.bib file於MODULES section
  2. 加入OS Dependencies for .NET Compact Framework 2.0及.NET Compact Framework 2.0 components
P.S. 我們可以利用此project建出來的SDK來開發其application

WinCE compiler after modifying reginit.ini

依下列步驟,
  1. 選擇"Open Release Directory",打開DOS視窗。 
  2. 執行"regcomp reginit.ini [release directory]"。 
  3. 執行"romimage ce.bib"。

WinCE compiler after modifying ce.bib

依下列步驟,
  1. 選擇"Open Release Directory",打開DOS視窗。 
  2. 執行"romimage ce.bib"。

WinCE6.0 R3增加Office Viewer

  1. http://www.microsoft.com/downloads/details.aspx?FamilyID=d2fd14eb-7d5c-428b-951c-343f910047c1&displaylang=en
    Download : WesttekFileViewers6.exe
  2. Install WesttekFileViewers6.exe
  3. Find “File Viewers” under “Third Party” directory in Catalog Items View
  4. Check office viewers or set “SYSGEN_EXCELVIEWER”, “SYSGEN_POWERPOINTVIEWER” and “SYSGEN_WORDVIEWER”, then the viewers will be included into OS
  5. Find the Excel viewer, PowerPoint viewer and so on in WinCE OS

什麼是Portable Media Center

Portable Media Centers is like Media to go
  Portable Media Centers put all of your favorite video, music, and pictures at your fingertips wherever you are. Take digital entertainment from your PC with you on the go, including recorded TV shows, downloaded videos, home movies, music, and photos. With Windows Mobile™ software featuring an easy-to-use, familiar Windows Media Center Edition interface, Portable Media Centers let you enjoy immediate access to all of your favorite entertainment - anytime, anywhere.

什麼是ECMA

ECMA是指國際標準規範組織
參考WiKi

WinCE support IDE Hard Disk

"atadisk.dll"提供了標準的IDE Hard Disk支援。

WinCE5.0 Support 4GB SD Card On MainstoneII

  1. 安裝WinCEPB50-070430-2007M04-Armv4I.msi patch,
    內含SDHC(KB933809)更新。 讓WinCE可支援SD High Capacity Card(4GB~32GB)
  2. 增加IMGSDBUS2=1環境變數,enable SD BUS 2支援。
  3. 修改Mainstone SDHC driver,如下:
    增加ResponseR7 support至sdcontrol.c檔,底下為部份程式碼。
    switch (pRequest->CommandResponse.ResponseType) {
        case NoResponse:
           cmdatRegister = MMC_CMDAT_RESPONSE_NONE;
        break;

        case ResponseR1b:
           // response1 with busy signaling
           cmdatRegister = MMC_CMDAT_RESPONSE_R1;
        break;

        case ResponseR1:
           ......
           ......

        case ResponseR7:
           // on an MMC controller R5 and R6 are really just an R1 response
           cmdatRegister = MMC_CMDAT_RESPONSE_R1;
        break;

        case ResponseR2:
           cmdatRegister = MMC_CMDAT_RESPONSE_R2;
        break;
        ......
        ......
       return SD_API_STATUS_INVALID_PARAMETER;

WinCE4.2 Enable SIS platform for two Ethernet

1.      set BSP_NIC_RTL8139=1set BSP_NIC_RTL81392=1set BSP_ICS=1
2.      增加ICS component包含ICS(Internet Connection Share)NAT(Networking Address Translation)。 

WinCE增加x86 COM Port

增加並修改registry設定。

EX:
增加第四個COM port,
  1. 於"[BSP name].bat"增加"set BSP_SERIAL4=1"。
  2. 於"platform.reg"增加,
    IF BSP_SERIAL4
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4]
    "SysIntr"=dword:1B ; 同BIOS interrupt加0x10,為16位元
    "IoBase"=dword:02E8 ; 同BIOS
    "IoLen"=dword:8
    "DeviceArrayIndex"=dword:3
    "Prefix"="COM"
    "Dll"="Com16550.Dll"
    "Order"=dword:0

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4\Unimodem]
    "Tsp"="Unimodem.dll"
    "DeviceType"=dword:0
    "FriendlyName"=LOC_FRIENDLYNAME_SERIAL4
    "DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00
    ENDIF BSP_SERIAL4

在Blog加入Facebook Link

可以參考
Facebook開發人員網站
Facebook Social Plugins

2013年10月18日 星期五

WinCE修改IE Default Code Page

更改 IE default codepage, 從 English 轉成 Chinese.

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\International]
"Default_CodePage"=hex:b6,03,00,00
"AcceptLanguage"="zh-tw,zh-cn;q=0.7"

WinCE修改File System Code Page

使用下列registry設定,
[HKEY_LOCAL_MACHINE\System\StorageManager\FATFS]
"CodePage" = dword:419

Locale IDs可參考微軟網站.
http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx

WinCE使用Hive-based Registry

  1. 增加 hive-based registry component
  2. 設定hive-based registry
    [HKEY_LOCAL_MACHINE\init\BootVars]
    "SYSTEMHIVE"="Registry\\system.hv" ; hive-based 檔案名稱
    "PROFILEDIR"="Registry" ; hive-based 檔案目錄
    "Start DevMgr"=dword:1
Example :
Implement hive-based registry with Hard Disk on NS platform.

; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE\init\BootVars]
"SYSTEMHIVE"="Documents and Settings\\system.hv"
"PROFILEDIR"="Documents and Settings"
"Start DevMgr"=dword:1
; END HIVE BOOT SECTION

; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile]
"MountFlags"=dword:2

[$(PCI_BUS_ROOT)\Template\GeodeIDE]
"Flags"=dword:1000 ; Set the bit to load during the first boot phase

[$(PCI_BUS_ROOT)\Template\GeodeIDE\Device0]
"Flags"=dword:1000

[LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\GeodeIDE\Device0]
"Prefix"="DSK"
"Dll"="atapi.dll"
"Settings"=dword:A ; Setting A to disable DMA
"DeviceId"=dword:0
"Ioctl"=dword:4
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
; END HIVE BOOT SECTION

WinCE6.0 SQL Server Compact 3.5 Usage


  1. 增加下列檔案至 bib file
    Modules
    sqlceme35.dll $(_FLATRELEASEDIR)\sqlceme35.dll NK
    sqlceca35.dll $(_FLATRELEASEDIR)\sqlceca35.dll NK
    sqlcecompact35.dll $(_FLATRELEASEDIR)\sqlcecompact35.dll NK
    sqlceer35EN.dll $(_FLATRELEASEDIR)\sqlceer35EN.dll NK
    sqlceoledb35.dll $(_FLATRELEASEDIR)\sqlceoledb35.dll NK
    sqlceqp35.dll $(_FLATRELEASEDIR)\sqlceqp35.dll NK
    sqlcese35.dll $(_FLATRELEASEDIR)\sqlcese35.dll NK
  2. 在postlink.bat file增加下列指令
    echo copying sqlceme35.dll
    copy "C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\armv4i\sqlceme35.dll"
  3. Rebuild the Windows Embedded CE 6.0 OS image

WinCE4.2 Add ADOCE


To use the ADOCE control, you need the following software:
  1. Microsoft Windows CE Services version 2.1 or later。
  2. Microsoft Windows NT Workstation version 4.0 or Windows 95 or 98 Microsoft Windows CE Platform SDK for the device you are using。
  3. Microsoft Visual Basic Professional Edition version 6.0, development system or Microsoft Visual Basic Enterprise Edition version 6.0。
  4. Microsoft Windows CE Toolkit for Visual Basic version 6.0。
The ADOCE control is included in the Windows CE Toolkit for Visual Basic.
Please refer http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce30/html/adoce30.asp
Add SQL Server CE 2.0 component。