• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FAILED_UNEXPECTEDLY函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FAILED_UNEXPECTEDLY函数的典型用法代码示例。如果您正苦于以下问题:C++ FAILED_UNEXPECTEDLY函数的具体用法?C++ FAILED_UNEXPECTEDLY怎么用?C++ FAILED_UNEXPECTEDLY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FAILED_UNEXPECTEDLY函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SHSetStrRet

HRESULT WINAPI CDesktopFolder::GetDetailsOf(
    PCUITEMID_CHILD pidl,
    UINT iColumn,
    SHELLDETAILS *psd)
{
    if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
        return E_INVALIDARG;

    if (!pidl)
    {
        psd->fmt = DesktopSFHeader[iColumn].fmt;
        psd->cxChar = DesktopSFHeader[iColumn].cxChar;
        return SHSetStrRet(&psd->str, DesktopSFHeader[iColumn].colnameid);
    }

    CComPtr<IShellFolder2> psf;
    HRESULT hr = _GetSFFromPidl(pidl, &psf);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    hr =  psf->GetDetailsOf(pidl, iColumn, psd);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    return hr;
}
开发者ID:mvardan,项目名称:reactos,代码行数:26,代码来源:CDesktopFolder.cpp


示例2: TRACE

// Stop tracking a system popup submenu
HRESULT CMenuFocusManager::PopTrackedPopup(HMENU popup)
{
    StackEntryType type;
    HMENU hmenu;
    HRESULT hr;

    TRACE("PopTrackedPopup %p\n", popup);

    hr = PopFromArray(&type, NULL, &hmenu);
    if (FAILED_UNEXPECTEDLY(hr))
    {
        UpdateFocus();
        return hr;
    }

    _ASSERT(type == TrackedMenuEntry);
    if (type != TrackedMenuEntry)
        return E_FAIL;

    if (hmenu != popup)
        return E_FAIL;

    hr = UpdateFocus();
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    return S_OK;
}
开发者ID:GYGit,项目名称:reactos,代码行数:29,代码来源:CMenuFocusManager.cpp


示例3: CISFBand_CreateInstance

HRESULT CBandSiteMenu::_CreateNewISFBand(HWND hwnd, REFIID riid, void** ppv)
{
    WCHAR path[MAX_PATH];
    WCHAR message[256];
    BROWSEINFOW bi = { hwnd, NULL, path };

    if (LoadStringW(GetModuleHandleW(L"browseui.dll"), IDS_BROWSEFORNEWTOOLAR, message, _countof(message)))
        bi.lpszTitle = message;
    else
        bi.lpszTitle = L"Choose a folder";

    CComHeapPtr<ITEMIDLIST> pidlSelected;
    pidlSelected.Attach(SHBrowseForFolderW(&bi));
    if (pidlSelected == NULL)
        return S_FALSE;

    CComPtr<IShellFolderBand> pISFB;
    HRESULT hr = CISFBand_CreateInstance(IID_IShellFolderBand, (PVOID*)&pISFB);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    hr = pISFB->InitializeSFB(NULL, pidlSelected);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    return pISFB->QueryInterface(riid, ppv);
}
开发者ID:Moteesh,项目名称:reactos,代码行数:27,代码来源:CBandSiteMenu.cpp


示例4: IUnknown_QueryService

HRESULT CMenuFocusManager::IsTrackedWindowOrParent(HWND hWnd)
{
    for (int i = m_bandCount; --i >= 0;)
    {
        StackEntry& entry = m_bandStack[i];

        if (entry.type != TrackedMenuEntry)
        {
            HRESULT hr = entry.mb->IsWindowOwner(hWnd);
            if (FAILED_UNEXPECTEDLY(hr))
                return hr;
            if (hr == S_OK)
                return S_OK;
            if (entry.mb->_IsPopup() == S_OK)
            {
                CComPtr<IUnknown> site;
                CComPtr<IOleWindow> pw;
                hr = entry.mb->GetSite(IID_PPV_ARG(IUnknown, &site));
                if (FAILED_UNEXPECTEDLY(hr))
                    continue;
                hr = IUnknown_QueryService(site, SID_SMenuBandParent, IID_PPV_ARG(IOleWindow, &pw));
                if (FAILED_UNEXPECTEDLY(hr))
                    continue;

                HWND hParent;
                if (pw->GetWindow(&hParent) == S_OK && hParent == hWnd)
                    return S_OK;
            }
        }
    }

    return S_FALSE;
}
开发者ID:GYGit,项目名称:reactos,代码行数:33,代码来源:CMenuFocusManager.cpp


示例5: CoCreateInstance

HRESULT CComCatCachedCategory::LoadFromComCatMgr()
{
    HRESULT hr;
    CComPtr<ICatInformation> pCatInformation;
    CComPtr<IEnumGUID> pEnumGUID;
    ULONG pFetched;
    CLSID tmp;

    // Get component categories manager instance
    hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
        IID_PPV_ARG(ICatInformation, &pCatInformation));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    // Get the proper enumerator
    hr = pCatInformation->EnumClassesOfCategories(1, &fCategory, NULL, NULL, &pEnumGUID);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    // Enumerate elements
    do
    {
        pFetched = 0;
        pEnumGUID->Next(1, &tmp, &pFetched);
        if (pFetched)
        {
            if (DSA_InsertItem(fLocalDsa, DSA_APPEND, &tmp) == E_OUTOFMEMORY)
                return E_OUTOFMEMORY;
        }
    }
    while (pFetched > 0);
    return S_OK;
}
开发者ID:GYGit,项目名称:reactos,代码行数:33,代码来源:comcat.cpp


示例6: pidl

HRESULT CBandSiteMenu::_AddISFBandToMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, IUnknown* pBand, DWORD dwBandID, UINT *newMenuId)
{
    CComPtr<IShellFolderBand> psfb;
    HRESULT hr = pBand->QueryInterface(IID_PPV_ARG(IShellFolderBand, &psfb));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    BANDINFOSFB bi = {ISFB_MASK_IDLIST};
    hr = psfb->GetBandInfoSFB(&bi);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    CComHeapPtr<ITEMIDLIST> pidl(bi.pidl);
    if (!pidl)
    {
        ERR("Failed to get the pidl of the CISFBand\n");
        return E_OUTOFMEMORY;
    }

    WCHAR buffer[MAX_PATH];
    hr = ILGetDisplayNameEx(NULL, pidl, buffer, ILGDN_INFOLDER) ? S_OK : E_FAIL;
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    UINT id = idCmdFirst + m_ComCatGuids.GetSize() + FIRST_COMCAT_MENU_ID + dwBandID;
    if (id >= idCmdLast)
        return E_FAIL;

    *newMenuId = id;
    InsertMenu(hmenu, indexMenu, MF_BYPOSITION, id, buffer);
    return S_OK;
}
开发者ID:Moteesh,项目名称:reactos,代码行数:32,代码来源:CBandSiteMenu.cpp


示例7: SHOpenFolderAndSelectItems

/***********************************************************************
 *  SHOpenFolderAndSelectItems
 *
 *   Unimplemented.
 */
EXTERN_C HRESULT
WINAPI
SHOpenFolderAndSelectItems(LPITEMIDLIST pidlFolder,
                           UINT cidl,
                           PCUITEMID_CHILD_ARRAY apidl,
                           DWORD dwFlags)
{
    ERR("SHOpenFolderAndSelectItems() is hackplemented\n");
    PCIDLIST_ABSOLUTE pidlItem;
    if (cidl)
    {
        /* Firefox sends a full pidl here dispite the fact it is a PCUITEMID_CHILD_ARRAY -_- */
        if (ILGetNext(apidl[0]) != NULL)
        {
            pidlItem = apidl[0];
        }
        else
        {
            pidlItem = ILCombine(pidlFolder, apidl[0]);
        }
    }
    else
    {
        pidlItem = pidlFolder;
    }

    CComPtr<IShellFolder> psfDesktop;

    HRESULT hr = SHGetDesktopFolder(&psfDesktop);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    STRRET strret;
    hr = psfDesktop->GetDisplayNameOf(pidlItem, SHGDN_FORPARSING, &strret);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    WCHAR wszBuf[MAX_PATH];
    hr = StrRetToBufW(&strret, pidlItem, wszBuf, _countof(wszBuf));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    WCHAR wszParams[MAX_PATH];
    wcscpy(wszParams, L"/select,");
    wcscat(wszParams, wszBuf);

    SHELLEXECUTEINFOW sei;
    memset(&sei, 0, sizeof sei);
    sei.cbSize = sizeof sei;
    sei.fMask = SEE_MASK_WAITFORINPUTIDLE;
    sei.lpFile = L"explorer.exe";
    sei.lpParameters = wszParams;

    if (ShellExecuteExW(&sei))
        return S_OK;
    else
        return E_FAIL;
}
开发者ID:Moteesh,项目名称:reactos,代码行数:63,代码来源:shlfolder.cpp


示例8: IUnknown_QueryService

HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
{
    ULONG eaten;
    ULONG attributes;
    HRESULT hr;
    HWND topLevelWindow;

    CComPtr<IShellBrowser> pisb;
    hr = IUnknown_QueryService(fSite, SID_SShellBrowser, IID_PPV_ARG(IShellBrowser, &pisb));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    hr = IUnknown_GetWindow(pisb, &topLevelWindow);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    LPWSTR input;
    int inputLength = fCombobox.GetWindowTextLength() + 2;

    input = new WCHAR[inputLength];
    fCombobox.GetWindowText(input, inputLength);

    LPWSTR address;
    int addressLength = ExpandEnvironmentStrings(input, NULL, 0);

    if (addressLength <= 0)
    {
        address = input;
    }
    else
    {
        addressLength += 2;
        address = new WCHAR[addressLength];
        if (!ExpandEnvironmentStrings(input, address, addressLength))
        {
            delete[] address;
            address = input;
        }
    }

    CComPtr<IShellFolder> psfDesktop;
    hr = SHGetDesktopFolder(&psfDesktop);
    if (SUCCEEDED(hr))
    {
        hr = psfDesktop->ParseDisplayName(topLevelWindow, NULL, address, &eaten, &pidlLastParsed, &attributes);
    }

    if (address != input)
        delete [] address;
    delete [] input;

    return hr;
}
开发者ID:GYGit,项目名称:reactos,代码行数:53,代码来源:addresseditbox.cpp


示例9: _ILCreateDesktop

HRESULT WINAPI CDesktopFolder::FinalConstruct()
{
    WCHAR szMyPath[MAX_PATH];
    HRESULT hr;

    /* Create the root pidl */
    pidlRoot = _ILCreateDesktop();
    if (!pidlRoot)
        return E_OUTOFMEMORY;

    /* Create the inner fs folder */
    hr = SHELL32_CoCreateInitSF(pidlRoot, 
                                NULL,
                                NULL,
                                &CLSID_ShellFSFolder,
                                CSIDL_DESKTOPDIRECTORY,
                                IID_PPV_ARG(IShellFolder2, &m_DesktopFSFolder));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    /* Create the inner shared fs folder. Dont fail on failure. */
    hr = SHELL32_CoCreateInitSF(pidlRoot, 
                                NULL,
                                NULL,
                                &CLSID_ShellFSFolder,
                                CSIDL_COMMON_DESKTOPDIRECTORY,
                                IID_PPV_ARG(IShellFolder2, &m_SharedDesktopFSFolder));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    /* Create the inner reg folder */
    hr = CRegFolder_CreateInstance(&CLSID_ShellDesktop,
                                   pidlRoot,
                                   L"", 
                                   IID_PPV_ARG(IShellFolder2, &m_regFolder));
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    /* Cache the path to the user desktop directory */
    if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE ))
        return E_UNEXPECTED;

    sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
    if (!sPathTarget)
        return E_OUTOFMEMORY;

    wcscpy(sPathTarget, szMyPath);
    return S_OK;
}
开发者ID:mvardan,项目名称:reactos,代码行数:49,代码来源:CDesktopFolder.cpp


示例10: SHGetPathFromIDListW

// Code is duplicated in CDefaultContextMenu
HRESULT CNewMenu::CreateNewFolder(LPCMINVOKECOMMANDINFO lpici)
{
    WCHAR wszPath[MAX_PATH];
    WCHAR wszName[MAX_PATH];
    WCHAR wszNewFolder[25];
    HRESULT hr;
    
    /* Get folder path */
    hr = SHGetPathFromIDListW(m_pidlFolder, wszPath);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    if (!LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, _countof(wszNewFolder)))
        return E_FAIL;

    /* Create the name of the new directory */
    if (!PathYetAnotherMakeUniqueName(wszName, wszPath, NULL, wszNewFolder))
        return E_FAIL;

    /* Create the new directory and show the appropriate dialog in case of error */
    if (SHCreateDirectory (lpici->hwnd, wszName) != ERROR_SUCCESS)
        return E_FAIL;

    /* Show and select the new item in the def view */
    SelectNewItem(lpici, SHCNE_MKDIR, SHCNF_PATHW, wszName);

    return S_OK;
}
开发者ID:GYGit,项目名称:reactos,代码行数:29,代码来源:CNewMenu.cpp


示例11: KillTimer

HRESULT CMenuToolbarBase::OnPopupTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    if (wParam != TIMERID_HOTTRACK)
    {
        bHandled = FALSE;
        return 0;
    }

    KillTimer(TIMERID_HOTTRACK);

    if (!m_timerEnabled)
        return 0;

    m_timerEnabled = FALSE;

    if (m_hotItem < 0)
        return 0;

    // Returns S_FALSE if the current item did not show a submenu
    HRESULT hr = PopupItem(m_hotItem, FALSE);
    if (hr != S_FALSE)
        return 0;

    // If we didn't switch submenus, cancel the current popup regardless
    if (m_popupBar)
    {
        HRESULT hr = CancelCurrentPopup();
        if (FAILED_UNEXPECTEDLY(hr))
            return 0;
    }

    return 0;
}
开发者ID:mvardan,项目名称:ros-svn-mirror,代码行数:33,代码来源:CMenuToolbars.cpp


示例12: SetImageList

HRESULT CMenuToolbarBase::UpdateImageLists()
{
    if ((m_initFlags & (SMINIT_TOPLEVEL | SMINIT_VERTICAL)) == SMINIT_TOPLEVEL) // not vertical.
    {
        // No image list, prevents the buttons from having a margin at the left side
        SetImageList(NULL);
        return S_OK;
    }

    // Assign the correct imagelist and padding based on the current icon size

    int shiml;
    if (m_menuBand->UseBigIcons())
    {
        shiml = SHIL_LARGE;
        SetPadding(4, 0);
    }
    else
    {
        shiml = SHIL_SMALL;
        SetPadding(4, 4);
    }

    IImageList * piml;
    HRESULT hr = SHGetImageList(shiml, IID_PPV_ARG(IImageList, &piml));
    if (FAILED_UNEXPECTEDLY(hr))
    {
        SetImageList(NULL);
    }
    else
    {
        SetImageList((HIMAGELIST)piml);
    }
    return S_OK;
}
开发者ID:mvardan,项目名称:ros-svn-mirror,代码行数:35,代码来源:CMenuToolbars.cpp


示例13: GetShellFolder

HRESULT CMenuSFToolbar::GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void **ppv)
{
    HRESULT hr;

    hr = m_shellFolder->QueryInterface(riid, ppv);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    if (pdwFlags)
        *pdwFlags = m_dwMenuFlags;

    if (ppidl)
    {
        LPITEMIDLIST pidl = NULL;

        if (m_idList)
        {
            pidl = ILClone(m_idList);
            if (!pidl)
            {
                ERR("ILClone failed!\n");
                (*reinterpret_cast<IUnknown**>(ppv))->Release();
                return E_FAIL;
            }
        }

        *ppidl = pidl;
    }

    return hr;
}
开发者ID:mvardan,项目名称:ros-svn-mirror,代码行数:31,代码来源:CMenuToolbars.cpp


示例14: GetDataFromId

HRESULT CMenuToolbarBase::PopupItem(INT iItem, BOOL keyInitiated)
{
    INT index;
    DWORD_PTR dwData;

    if (iItem < 0)
        return S_OK;

    if (m_popupBar == this && m_popupItem == iItem)
        return S_OK;

    GetDataFromId(iItem, &index, &dwData);

    HRESULT hr = InternalHasSubMenu(iItem, index, dwData);
    if (hr != S_OK)
        return hr;

    if (m_popupBar)
    {
        HRESULT hr = CancelCurrentPopup();
        if (FAILED_UNEXPECTEDLY(hr))
            return hr;
    }

    if (!(m_initFlags & SMINIT_VERTICAL))
    {
        TRACE("PopupItem non-vertical %d %d\n", index, iItem);
        m_menuBand->_ChangeHotItem(this, iItem, 0);
    }

    return InternalPopupItem(iItem, index, dwData, keyInitiated);
}
开发者ID:mvardan,项目名称:ros-svn-mirror,代码行数:32,代码来源:CMenuToolbars.cpp


示例15: while

// Used so that the toolbar can properly ignore mouse events, when the menu is being used with the keyboard
void CMenuFocusManager::DisableMouseTrack(HWND parent, BOOL disableThis)
{
    BOOL bDisable = FALSE;
    BOOL lastDisable = FALSE;

    int i = m_bandCount;
    while (--i >= 0)
    {
        StackEntry& entry = m_bandStack[i];

        if (entry.type != TrackedMenuEntry)
        {
            HWND hwnd;
            HRESULT hr = entry.mb->_GetTopLevelWindow(&hwnd);
            if (FAILED_UNEXPECTEDLY(hr))
                break;

            if (hwnd == parent)
            {
                lastDisable = disableThis;
                entry.mb->_DisableMouseTrack(disableThis);
                bDisable = TRUE;
            }
            else
            {
                lastDisable = bDisable;
                entry.mb->_DisableMouseTrack(bDisable);
            }
        }
    }
    m_mouseTrackDisabled = lastDisable;
}
开发者ID:GYGit,项目名称:reactos,代码行数:33,代码来源:CMenuFocusManager.cpp


示例16: switch

HRESULT STDMETHODCALLTYPE CAddressBand::OnWinEvent(
    HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
{
    CComPtr<IWinEventHandler>               winEventHandler;
    HRESULT                                 hResult;
    RECT                                    rect;

    if (theResult)
        *theResult = 0;

    switch (uMsg)
    {
        case WM_WININICHANGE:
            break;
        case WM_COMMAND:
            if (wParam == IDM_TOOLBARS_GOBUTTON)
            {
                fGoButtonShown = !SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"ShowGoButton", FALSE, TRUE);
                SHRegSetUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"ShowGoButton", REG_SZ, fGoButtonShown ? (LPVOID)L"yes" : (LPVOID)L"no", fGoButtonShown ? 8 : 6, SHREGSET_FORCE_HKCU);
                if (!fGoButton)
                    CreateGoButton();
                ::ShowWindow(fGoButton,fGoButtonShown ? SW_HIDE : SW_SHOW);
                GetWindowRect(&rect);
                SendMessage(m_hWnd,WM_SIZE,0,MAKELPARAM(rect.right-rect.left,rect.bottom-rect.top));
                // broadcast change notification to all explorer windows
            }
            break;
    }
    hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
    if (FAILED_UNEXPECTEDLY(hResult))
        return hResult;
    return winEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
}
开发者ID:Moteesh,项目名称:reactos,代码行数:33,代码来源:addressband.cpp


示例17: SHELL32_SetNameOfGuidItem

HRESULT SHELL32_SetNameOfGuidItem(PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
{
    GUID const *clsid = _ILGetGUIDPointer (pidl);
    LPOLESTR pStr;
    HRESULT hr;
    WCHAR szName[100];

    if (!clsid)
    {
        ERR("Pidl is not reg item!\n");
        return E_FAIL;
    }

    hr = StringFromCLSID(*clsid, &pStr);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    swprintf(szName, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\%s", pStr);

    DWORD cbData = (wcslen(lpName) + 1) * sizeof(WCHAR);
    LONG res = SHSetValueW(HKEY_CURRENT_USER, szName, NULL, RRF_RT_REG_SZ, lpName, cbData);

    CoTaskMemFree(pStr);

    if (res == ERROR_SUCCESS)
    {
        *pPidlOut = ILClone(pidl);
        return S_OK;
    }

    return E_FAIL;
}
开发者ID:GYGit,项目名称:reactos,代码行数:32,代码来源:shlfolder.cpp


示例18: IsTrackedWindow

HRESULT CMenuFocusManager::IsTrackedWindow(HWND hWnd, StackEntry ** pentry)
{
    if (pentry)
        *pentry = NULL;

    for (int i = m_bandCount; --i >= 0;)
    {
        StackEntry& entry = m_bandStack[i];

        if (entry.type != TrackedMenuEntry)
        {
            HRESULT hr = entry.mb->IsWindowOwner(hWnd);
            if (FAILED_UNEXPECTEDLY(hr))
                return hr;
            if (hr == S_OK)
            {
                if (pentry)
                    *pentry = &entry;
                return S_OK;
            }
        }
    }

    return S_FALSE;
}
开发者ID:GYGit,项目名称:reactos,代码行数:25,代码来源:CMenuFocusManager.cpp


示例19: TRACE

/**************************************************************************
 *    CDesktopFolder::GetDisplayNameOf
 *
 * NOTES
 *    special case: pidl = null gives desktop-name back
 */
HRESULT WINAPI CDesktopFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
{
    TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
    pdump (pidl);

    if (!strRet)
        return E_INVALIDARG;

    if (!_ILIsPidlSimple (pidl))
    {
        return SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, strRet);
    }
    else if (_ILIsDesktop(pidl))
    {
        if ((GET_SHGDN_RELATION(dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING))
            return SHSetStrRet(strRet, sPathTarget);
        else
            return HCR_GetClassName(CLSID_ShellDesktop, strRet);
    }

    /* file system folder or file rooted at the desktop */
    CComPtr<IShellFolder2> psf;
    HRESULT hr = _GetSFFromPidl(pidl, &psf);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    return psf->GetDisplayNameOf(pidl, dwFlags, strRet);
}
开发者ID:mvardan,项目名称:reactos,代码行数:34,代码来源:CDesktopFolder.cpp


示例20: FIXME

HRESULT CSHEnumClassesOfCategories::Initialize(ULONG cImplemented, CATID *pImplemented, ULONG cRequired, CATID *pRequired)
{
    UINT i;
    HRESULT hr;

    if (!fDsa)
        return E_FAIL;

    if (cRequired > 0 || cImplemented == (ULONG)-1)
    {
        FIXME("Implement required categories class enumeration\n");
        return E_NOTIMPL;
    }

    // Don't do anything if we have nothing
    if (cRequired == 0 && cImplemented == (ULONG)-1)
        return E_FAIL;

    // For each implemented category, create a cache and add it to our local DSA
    for (i = 0; i < cImplemented; i++)
    {
        CComCatCachedCategory cachedCat;
        hr = cachedCat.Initialize(pImplemented[i], FALSE);
        if (FAILED_UNEXPECTEDLY(hr))
            return hr;
        cachedCat.WriteCacheToDSA(fDsa);
    }
    return S_OK;
}
开发者ID:GYGit,项目名称:reactos,代码行数:29,代码来源:comcat.cpp



注:本文中的FAILED_UNEXPECTEDLY函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FAILURE函数代码示例发布时间:2022-05-30
下一篇:
C++ FAILED函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap