プロダクトコードの列挙

(2004.03.30)
    // プロダクトコードの列挙
    static HRESULT EnumProductCodes(std::vector<CString>& strProductCodes)
    {
        strProductCodes.clear();
 
        int i = 0;
        UINT nr = ERROR_SUCCESS;
        while (nr != ERROR_NO_MORE_ITEMS)
        {
            TCHAR szProductCode[39];
            nr = ::MsiEnumProducts(i, szProductCode);
            if ((nr != ERROR_SUCCESS) && (nr != ERROR_NO_MORE_ITEMS))
            {
                // エラー
                return E_FAIL;
            }
 
            strProductCodes.push_back(szProductCode);
            i++;
        }
 
        return S_OK;
    }
一覧に戻る
© 2003 WAC.com All Right Reserved.