Một số chỉnh sửa cần thiết để compile source code Unikey 3.6.2

321 views
Skip to first unread message

Hà Thế Tùng

unread,
Jun 13, 2011, 10:47:29 PM6/13/11
to unike...@googlegroups.com
Sau một thời gian mày mò thì em cũng xin ra lò 1 blog đầu tiên
  1. Download source Unikey 3.6.2: http://prdownloads.sourceforge.net/unikey/Uk362src.zip và giải nén vào [path]
  2. Mở file [path]\newkey\newkey.sln bằng Visual Studio 2005 và convert project cho tương thích với VS2005 (Conversion Wizard)
  3. Sửa các file sau đây:
    • [path]\keyhook\vietkey.cpp
      • line 1035:
        WideCharToMultiByte(CP_US_ANSI, 0, p, -1, (char *)ansiPush, sizeof(ansiPush), NULL, NULL);
        --> WideCharToMultiByte(CP_US_ANSI, 0, (LPCWSTR)p, -1, (char *)ansiPush, sizeof(ansiPush), NULL, NULL);
    • [path]\keyhook\keyhook.cpp
      • line 444:
        int count = WideCharToMultiByte(1258, 0, VnKbd.uniPush, VnKbd.keysPushed, (char *)VnKbd.ansiPush, VnKbd.keysPushed, 0, 0);
        --> int count = WideCharToMultiByte(1258, 0, (LPCWSTR)VnKbd.uniPush, VnKbd.keysPushed, (char *)VnKbd.ansiPush, VnKbd.keysPushed, 0, 0);
    • [path]\vnconv\charset.cpp
      • line 164:
        int k;
        --> int i, k;
      • line 1106:
        int k;
        --> int i, k;
    • [path]\newkey\tooldlg.cpp
      • line 669:
        static lastFormat = CF_TEXT; // format of last converted clipboard (CF_TEXT or CF_UNICODETEXT)
        --> static int lastFormat = CF_TEXT; // format of last converted clipboard (CF_TEXT or CF_UNICODETEXT)
    • [path]\newkey\mactab.cpp
      • line 145:
        char * pos = strchr(item, ':');
        --> char * pos = const_cast<char*> (strchr(item, ':'));
    • [path]\newkey\label.h
      • line 107:
        static setLinkCursor(HCURSOR hCursor)
        --> static void setLinkCursor(HCURSOR hCursor)
  4. Build project NewKey với config Win32 Release hoặc Win32 Unicode Release. Theo em thấy từ góc độ người dùng 2 cái này khác nhau ở chỗ bản Unicode Release có thể chuyển sang giao diện tiếng Việt, còn bản Release thì không.

Anh Hưng và Trung confirm xem các bước làm như vậy có đúng không?

Hic, nhìn code chóng mặt quá, dòng hiểu dòng không :(

    Best Regards,
    --
    Hà Thế Tùng | tunght13488 at gmail dot com
    Mobile: 0164 720 4708
    Y!M: tunght13488 | Skype: tunght13488
    Số 103, ngõ 7, Thụy Khuê, Tây Hồ, Hà Nội

    Nguyen Vu Hung

    unread,
    Jun 14, 2011, 1:32:32 AM6/14/11
    to unike...@googlegroups.com

    Good, Trung build thu nhe. Co gi se hoi them a pk Long

    Hà Thế Tùng

    unread,
    Jun 14, 2011, 7:53:16 AM6/14/11
    to unikeyspell
    Phần nay em gửi từ mail, có format bold + italic dễ nhìn nhưng khi
    chuyển vào discussion bị mất, thay vào đó là một số kí tự *.
    Vì vậy em edit lại phần 3:

    - [path]\keyhook\vietkey.cpp
    + line 1035:
    WideCharToMultiByte(CP_US_ANSI, 0, p, -1, (char *)ansiPush,
    sizeof(ansiPush), NULL, NULL);
    --> WideCharToMultiByte(CP_US_ANSI, 0, (LPCWSTR)p, -1, (char
    *)ansiPush, sizeof(ansiPush), NULL, NULL);

    - [path]\keyhook\keyhook.cpp
    + line 444:
    int count = WideCharToMultiByte(1258, 0, VnKbd.uniPush,
    VnKbd.keysPushed, (char *)VnKbd.ansiPush, VnKbd.keysPushed, 0, 0);
    --> int count = WideCharToMultiByte(1258, 0,
    (LPCWSTR)VnKbd.uniPush, VnKbd.keysPushed, (char *)VnKbd.ansiPush,
    VnKbd.keysPushed, 0, 0);

    - [path]\vnconv\charset.cpp
    + line 164:
    int k;
    --> int i, k;

    + line 1106:
    int k;
    --> int i, k;

    - [path]\newkey\tooldlg.cpp
    + line 669:
    static lastFormat = CF_TEXT; // format of last converted
    clipboard (CF_TEXT or CF_UNICODETEXT)
    --> static int lastFormat = CF_TEXT; // format of last converted
    clipboard (CF_TEXT or CF_UNICODETEXT)

    - [path]\newkey\mactab.cpp
    + line 145:
    char * pos = strchr(item, ':');
    --> char * pos = const_cast<char*> (strchr(item, ':'));

    - [path]\newkey\label.h
    + line 107:
    static setLinkCursor(HCURSOR hCursor)
    --> static void setLinkCursor(HCURSOR hCursor)

    On Jun 14, 12:32 pm, Nguyen Vu Hung <vuhung16p...@gmail.com> wrote:
    > Good, Trung build thu nhe. Co gi se hoi them a pk Long
    >
    > On Jun 14, 2011 9:48 AM, "Hà Thế Tùng" <tunght13...@gmail.com> wrote:
    >
    > Sau một thời gian mày mò thì em cũng xin ra lò 1 blog đầu tiên
    >
    >    1. Download source Unikey 3.6.2:
    >    http://prdownloads.sourceforge.net/unikey/Uk362src.zipvà giải nén vào *
    >    [path]*
    >    2. Mở file *[path]\newkey\newkey.sln* bằng Visual Studio 2005 và convert
    >    project cho tương thích với VS2005 (Conversion Wizard)
    >    3. Sửa các file sau đây:
    >       - *[path]\keyhook\vietkey.cpp*
    >          - line 1035:
    >          WideCharToMultiByte(CP_US_ANSI, 0, p, -1, (char *)ansiPush,
    >          sizeof(ansiPush), NULL, NULL);
    >          --> WideCharToMultiByte(CP_US_ANSI, 0, *(LPCWSTR)*p, -1, (char
    >          *)ansiPush, sizeof(ansiPush), NULL, NULL);
    >       - *[path]\keyhook\keyhook.cpp*
    >          - line 444:
    >          int count = WideCharToMultiByte(1258, 0, VnKbd.uniPush,
    >          VnKbd.keysPushed, (char *)VnKbd.ansiPush, VnKbd.keysPushed, 0, 0);
    >          --> int count = WideCharToMultiByte(1258, 0, *(LPCWSTR)*VnKbd.uniPush,
    >          VnKbd.keysPushed, (char *)VnKbd.ansiPush, VnKbd.keysPushed, 0, 0);
    >       - *[path]\vnconv\charset.cpp*
    >          - line 164:
    >          int k;
    >          --> int *i,* k;
    >          - line 1106:
    >          int k;
    >          --> int *i,* k;
    >       - *[path]\newkey\tooldlg.cpp*
    >          - line 669:
    >          static lastFormat = CF_TEXT; // format of last converted clipboard
    >          (CF_TEXT or CF_UNICODETEXT)
    >          --> static *int *lastFormat = CF_TEXT; // format of last converted
    >          clipboard (CF_TEXT or CF_UNICODETEXT)
    >       - *[path]\newkey\mactab.cpp*
    >          - line 145:
    >          char * pos = strchr(item, ':');
    >          --> char * pos = *const_cast<char*> (*strchr(item, ':')*)*;
    >       - *[path]\newkey\label.h*
    >          - line 107:
    >          static setLinkCursor(HCURSOR hCursor)
    >          --> static *void *setLinkCursor(HCURSOR hCursor)
    >       4. Build project *NewKey* với config *Win32 Release* hoặc *Win32
    >    Unicode Release*. Theo em thấy từ góc độ người dùng 2 cái này khác nhau ở
    >    chỗ bản *Unicode Release có thể chuyển sang giao diện tiếng Việt*, còn
    >    bản Release thì không.
    >
    > Anh Hưng và Trung confirm xem các bước làm như vậy có đúng không?
    >
    > Hic, nhìn code chóng mặt quá, dòng hiểu dòng không :(
    >
    > Best Regards,
    > --
    > *Hà Thế Tùng *|* tunght13488 at gmail dot com*

    Nguyen Vu Hung

    unread,
    Jun 15, 2011, 11:22:42 AM6/15/11
    to unike...@googlegroups.com

    Em commit code trước và sau khi sửa lên svn của google code nhé

    2011/06/14 18:53 "Hà Thế Tùng" <tungh...@gmail.com>:



    Phần nay em gửi từ mail, có format bold + italic dễ nhìn nhưng khi
    chuyển vào discussion bị mất, thay vào đó là một số kí tự *.
    Vì vậy em edit lại phần 3:

         - [path]\keyhook\vietkey.cpp

    + line 1035:
    WideCharToMultiByte(CP_US_ANSI, 0, p, -1, (char *)ansiPush,

    sizeof(an...

    On Jun 14, 12:32 pm, Nguyen Vu Hung <vuhung16p...@gmail.com> wrote:

    > Good, Trung build thu nhe. Co ...

    > On Jun 14, 2011 9:48 AM, "Hà Thế Tùng" <tunght13...@gmail.com> wrote:
    >

    > Sau một thời gian mày mò...

    >    1. Download source Unikey 3.6.2:
    >    http://prdownloads.sourceforge.net/unikey/Uk362src.zipvà giải nén vào *
    >    [path]*
    >    2. Mở file *[path]\newkey\newkey.sln* bằng Visual Studio 2005 và convert

    >    project cho tương thích với VS2005 (Conversion Wizard)

    >    3. Sửa các file sau đây:

    >       - *[path]\keyhook\vietkey.cpp*
    >          - line 1035:

    >          WideCharToMultiByte(CP_US_...

    >       4. Build project *NewKey* với config *Win32 Release* hoặc *Win32

    >    Unicode Release*. Theo em thấy từ góc độ người dùng 2 cái này khác nhau ở

    >    chỗ bản *Unicode...

    Reply all
    Reply to author
    Forward
    0 new messages