2013年6月10日 星期一

How to install the NGO common library

1.  請下載兩個檔案

  • NGO_CL_Installer.msi
  • setup.exe

2. 安裝步驟如下:

2.1 啟動安裝精靈
    NGO_setup1

2.2 指定應用程式的根目錄 C:\rcm3app (請依實際目錄路徑)
    NGO_setup2

2.3 確認安裝
    NGO_setup3

2.4 安裝完成
    NGO_setup4

2.5 部置檔案目錄結構
    NGO_setup5

3. VC++專案, 請於專案屬性加入下述兩點路徑

  • Inlcude Path : c:\acl3app\src\common\inc
  • Library Path : c:\acl3app\lib

4. 即可進行專案編譯

2013年6月8日 星期六

How to pack NGO common library into a Installer

目前NGO common library完成度已接近80%, 起先顧及bug太多, 與方便修正的即時性,  皆先發佈source code給同仁編譯使用, 但這麼一來就容易造成版本的問題及維護整合的困難性

是該以library package的形式, 後續發佈給大家使用, 便想到以封裝成install檔案, 不知可行性如何??

經過實際試做後, 建議可以先針對下述兩點, 略做規劃:

第一. 要發佈哪些檔案??
1. common.lib              (NGO common library)
2. mqoa.dll                    (MSMQ library)
3. msado15.dll             (MS ADO library)
4. oncrpcms.dll            (ONC rpc library for MS)
5. oncrpc.dll                  (ONC rpc library)
6. head file

第二. 要如何配置目錄路徑
c:\rcm3app
                      ---> \lib                                  (存放*.dll and *.lib)
                      ---> \src\common\inc      (存放*.h)

Install_Directory

第三. 如何使用Visual Studio製作安裝檔?  (可以參考下列推薦網站連結唷!!)

2013年6月7日 星期五

手動設定 VS 2010 的 VC++ IncludePath/LibraryPath/OutputPath

在建立新專案時, 總是要逐一設定專案屬性的輸出目錄 / include目錄 / library目錄, 雖有複製貼上的神技, 但有沒有方法可以變成自行定義的預設初始化路徑...

只要編輯下述兩個檔案, 即可輕輕鬆鬆建立新專案

x86 (win32) : Microsoft.Cpp.Win32.v100.props
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v100\Microsoft.Cpp.Win32.v100.props

x64 (win32) : Microsoft.Cpp.x64.v100.props
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\PlatformToolsets\v100\Microsoft.Cpp.x64.v100.props

開啟編輯上述任一檔案時, 注意下面的文字結構, 黃色標示部份, 為自行定義加入的路徑變數, 存檔再重新開啟visual studio就可以看到, 已自動加入專案屬性的目錄路徑

<PropertyGroup>
<OutDir>$(AppBinPath)\</OutDir>
<IncludePath Condition="'$(IncludePath)' == ''">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(AppDirPath)\src\common\inc;$(AppDirPath)\src\inc;</IncludePath>
<LibraryPath Condition="'$(LibraryPath)' == ''">$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;$(AppDirPath)\lib;$(AppDirPath)\src;$(AppDirPath)\src\common\dll;</LibraryPath>
</PropertyGroup>

參考來源 :: http://idaiwan.pixnet.net/blog/post/30789152

How to use IniHandler??

1. 作為讀取參數設定檔之用途

2. INI file format (內容嚴禁空白)
[SectionName]
key=value
[Host]
ipaddress=192.168.19.1
port=9999
[RCM3]
ipaddress=192.168.19.2
port=8888


PS: 將上述(2)內容存檔於C:\ipaddress.ini

ex:
#include “IniHandler.h”

main (void)
{
/* 建立 INI file handler */
IniHandler ini_hand;

/* 打開INI file */
ini_hand.open ("c:\\ipaddress.ini");

/* 讀取所有的Section Name */
vSectionNames_T names = ini_hand.readSectionNames ();

vSection_T section;
/* 逐一以Section Name, 讀取該Section內所有的key value */
for (int i=0; i<(int)names.size(); i++) {
    ap_log (DBUG, "get the tag %s", names[i].c_str());

    section.clear ();
    /* 帶入section name, 讀取 key-value */
    section = ini_hand.readKeyValues ((char *)names[i].c_str());

    /* 逐一印出key-value */
    for (int j=0; j<(int)section.size(); j++) {
        ap_log (DBUG, "key = %s, values = %s", section[j].key, section[j].value);
    }
}
/* 關閉 INI file */
ini_hand.close ();
}