亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tenant.cpp

?? 英文版的 想要的話可以下載了 為大家服務
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
    hr=ReadFmtUserTypeStg(m_pIStorage, pwFormat, ppszType);

    if (FAILED(hr))
        {
        *pwFormat=0;
        *ppszType=NULL;

        if (INOLE_GetUserTypeOfClass(*pClsID, 0, szType
            , sizeof(szType)))
            {
            *ppszType=INOLE_CopyString(szType);
            }
        }

    /*
     * Try to get the AuxUserType from the registry, using
     * the short version (registered under AuxUserType\2).
     * If that fails, just copy *ppszType.
     */
    *ppszLabel=NULL;

    if (INOLE_GetUserTypeOfClass(*pClsID, 2, szType
        , sizeof(szType)))
        {
        *ppszLabel=INOLE_CopyString(szType);
        }
    else
        *ppszLabel=INOLE_CopyString(*ppszType);

    //Get the icon for this thing, if we're iconic.
    *phMetaIcon=NULL;

    hr=m_pObj->QueryInterface(IID_IDataObject
        , (PPVOID)&pIDataObject);

    if (SUCCEEDED(hr))
        {
        SETFormatEtc(fe, CF_METAFILEPICT, DVASPECT_ICON, NULL
            , TYMED_MFPICT, -1);
        hr=pIDataObject->GetData(&fe, &stm);
        pIDataObject->Release();

        if (SUCCEEDED(hr))
            *phMetaIcon=stm.hGlobal;
        else
            *phMetaIcon=OleGetIconOfClass(*pClsID, NULL, TRUE);
        }

    return;
    }




/*
 * CTenant::SwitchOrUpdateAspect
 *
 * Purpose:
 *  Switches between DVASPECT_CONTENT and DVASPECT_ICON
 *
 * Parameters:
 *  hMetaIcon       HGLOBAL to the new icon if we're changing the
 *                  icon or switching to DVASPECT_ICON.  NULL to
 *                  change back to content.
 *  fPreserve       BOOL indicating if we're to preserve the old
 *                  aspect after changing.
 *
 * Return Value:
 *  BOOL            TRUE if anything changed, FALSE otherwise.
 */

BOOL CTenant::SwitchOrUpdateAspect(HGLOBAL hMetaIcon
    , BOOL fPreserve)
    {
    HRESULT     hr;
    DWORD       dwAspect;
    BOOL        fUpdate=FALSE;

    //Nothing to do if we're content already and there's no icon.
    if (NULL==hMetaIcon && DVASPECT_CONTENT==m_fe.dwAspect)
        return FALSE;

    //If we're iconic already, just cache the new icon
    if (NULL!=hMetaIcon && DVASPECT_ICON==m_fe.dwAspect)
        hr=INOLE_SetIconInCache(m_pIOleObject, hMetaIcon);
    else
        {
        //Otherwise, switch between iconic and content.
        dwAspect=(NULL==hMetaIcon) ? DVASPECT_CONTENT : DVASPECT_ICON;

        /*
         * Switch between aspects, where dwAspect has the new one
         * and m_fe.dwAspect will be changed in the process.
         */
        hr=INOLE_SwitchDisplayAspect(m_pIOleObject
            , &m_fe.dwAspect, dwAspect, hMetaIcon, !fPreserve
            , TRUE, m_pImpIAdviseSink, &fUpdate);

        if (SUCCEEDED(hr))
            {
            //Update MiscStatus for the new aspect
            m_pIOleObject->GetMiscStatus(m_fe.dwAspect, &m_grfMisc);

            if (fUpdate)
                m_pIOleObject->Update();    //This repaints.
            }
        }

    //If we switched, update our extents.
    if (SUCCEEDED(hr))
        {
        SIZEL       szl;

        m_pIOleObject->GetExtent(m_fe.dwAspect, &szl);

        if (0 > szl.cy)
            szl.cy=-szl.cy;

        //Convert HIMETRIC absolute units to our LOMETRIC mapping
        if (0!=szl.cx && 0!=szl.cy)
            SETSIZEL(szl, szl.cx/10, -szl.cy/10);

        Invalidate();                   //Remove old aspect
        SizeSet(&szl, FALSE, FALSE);    //Change size
        Repaint();                      //Paint the new one
        }

    return SUCCEEDED(hr);
    }



/*
 * CTenant::EnableRepaint
 *
 * Purpose:
 *  Toggles whether the Repaint function does anything.  This
 *  is used during conversion/emulation of an object to disable
 *  repaints until the new object can be given the proper extents.
 *
 * Parameters:
 *  fEnable         TRUE to enable repaints, FALSE to disable.
 *
 * Return Value:
 *  None
 */

void CTenant::EnableRepaint(BOOL fEnable)
    {
    m_fRepaintEnabled=fEnable;
    return;
    }
//End CHAPTER17MOD








/*
 * CTenant::ObjectGet
 *
 * Purpose:
 *  Retrieves the LPUNKNOWN of the object in use by this tenant
 *
 * Parameters:
 *  ppUnk           LPUNKNOWN * in which to return the object
 *                  pointer.
 *
 * Return Value:
 *  None
 */

void CTenant::ObjectGet(LPUNKNOWN *ppUnk)
    {
    if (NULL!=ppUnk)
        {
        *ppUnk=m_pObj;
        m_pObj->AddRef();
        }

    return;
    }





/*
 * CTenant::FormatEtcGet
 *
 * Purpose:
 *  Retrieves the FORMATETC in use by this tenant
 *
 * Parameters:
 *  pFE             LPFORMATETC in which to store the information.
 *  fPresentation   BOOL indicating if we want the real format or
 *                  that of the presentation.
 *
 * Return Value:
 *  None
 */

void CTenant::FormatEtcGet(LPFORMATETC pFE, BOOL fPresentation)
    {
    if (NULL!=pFE)
        {
        *pFE=m_fe;

        //CHAPTER17MOD
        //If there is no format, use metafile (for embedded objects)
        if (fPresentation || 0==pFE->cfFormat)
            {
            //Don't mess with dwAspect; might be icon or content.
            pFE->cfFormat=CF_METAFILEPICT;
            pFE->tymed=TYMED_MFPICT;
            }
        //End CHAPTER17MOD
        }

    return;
    }





/*
 * CTenant::SizeGet
 * CTenant::SizeSet
 * CTenant::RectGet
 * CTenant::RectSet
 *
 * Purpose:
 *  Returns or sets the size/position of the object contained here.
 *
 * Parameters:
 *  pszl/prcl       LPSIZEL (Size) or LPRECTL (Rect) with the
 *                  extents of interest.  In Get situations,
 *                  this will receive the extents; in Set it
 *                  contains the extents.
 *  fDevice         BOOL indicating that pszl/prcl is expressed
 *                  in device units.  Otherwise it's LOMETRIC.
 *  fInformObj      (Set Only) BOOL indicating if we need to inform
 *                  the object all.
 *
 * Return Value:
 *  None
 */

void CTenant::SizeGet(LPSIZEL pszl, BOOL fDevice)
    {
    if (!fDevice)
        {
        pszl->cx=m_rcl.right-m_rcl.left;
        pszl->cy=m_rcl.bottom-m_rcl.top;
        }
    else
        {
        RECT        rc;

        SetRect(&rc, (int)(m_rcl.right-m_rcl.left)
            , (int)(m_rcl.bottom-m_rcl.top), 0, 0);

        RectConvertMappings(&rc, NULL, TRUE);

        pszl->cx=(long)rc.left;
        pszl->cy=(long)rc.top;
        }

    return;
    }

//CHAPTER17MOD
void CTenant::SizeSet(LPSIZEL pszl, BOOL fDevice, BOOL fInformObj)
//End CHAPTER17MOD
    {
    SIZEL           szl;

    if (!fDevice)
        {
        szl=*pszl;
        m_rcl.right =pszl->cx+m_rcl.left;
        m_rcl.bottom=pszl->cy+m_rcl.top;
        }
    else
        {
        RECT        rc;

        SetRect(&rc, (int)pszl->cx, (int)pszl->cy, 0, 0);
        RectConvertMappings(&rc, NULL, FALSE);

        m_rcl.right =(long)rc.left+m_rcl.left;
        m_rcl.bottom=(long)rc.top+m_rcl.top;

        SETSIZEL(szl, (long)rc.left, (long)rc.top);
        }


    //Tell OLE that this object was resized.
    //CHAPTER17MOD
    if (NULL!=m_pIOleObject && fInformObj)
        {
        HRESULT     hr;
        BOOL        fRun=FALSE;

        //Convert our LOMETRIC into HIMETRIC by *=10
        szl.cx*=10;
        szl.cy*=-10;    //Our size is stored negative.

        /*
         * If the MiscStatus bit of OLEMISC_RECOMPOSEONRESIZE
         * is set, then we need to run the object before calling
         * SetExtent to make sure it has a real chance to
         * re-render the object.  We have to update and close
         * the object as well after this happens.
         */

        if (OLEMISC_RECOMPOSEONRESIZE & m_grfMisc)
            {
            if (!OleIsRunning(m_pIOleObject))
                {
                OleRun(m_pIOleObject);
                fRun=TRUE;
                }
            }

        hr=m_pIOleObject->SetExtent(m_fe.dwAspect, &szl);

        /*
         * If the object is not running and it does not have
         * RECOMPOSEONRESIZE, then SetExtent fails.  Make
         * sure that we call SetExtent again (by just calling
         * SizeSet here again) when we next run the object.
         */
        if (SUCCEEDED(hr))
            {
            m_fSetExtent=FALSE;

            if (fRun)
                {
                m_pIOleObject->Update();
                m_pIOleObject->Close(OLECLOSE_SAVEIFDIRTY);
                }
            }
        else
            {
            if (OLE_E_NOTRUNNING==GetScode(hr))
                m_fSetExtent=TRUE;
            }
        }
    //End CHAPTER17MOD

    return;
    }


void CTenant::RectGet(LPRECTL prcl, BOOL fDevice)
    {
    if (!fDevice)
        *prcl=m_rcl;
    else
        {
        RECT        rc;

        RECTFROMRECTL(rc, m_rcl);
        RectConvertMappings(&rc, NULL, TRUE);
        RECTLFROMRECT(*prcl, rc);
        }

    return;
    }


//CHAPTER17MOD
void CTenant::RectSet(LPRECTL prcl, BOOL fDevice, BOOL fInformObj)
//End CHAPTER17MOD
    {
    SIZEL   szl;
    LONG    cx, cy;

    cx=m_rcl.right-m_rcl.left;
    cy=m_rcl.bottom-m_rcl.top;

    if (!fDevice)
        m_rcl=*prcl;
    else
        {
        RECT        rc;

        RECTFROMRECTL(rc, *prcl);
        RectConvertMappings(&rc, NULL, FALSE);
        RECTLFROMRECT(m_rcl, rc);
        }

    /*
     * Tell ourselves that the size changed, if it did.  SizeSet
     * will call IOleObject::SetExtent for us.
     */
    if ((m_rcl.right-m_rcl.left)!=cx || (m_rcl.bottom-m_rcl.top)!=cy)
        {
        SETSIZEL(szl, m_rcl.right-m_rcl.left, m_rcl.bottom-m_rcl.top);
        //CHAPTER17MOD
        SizeSet(&szl, FALSE, fInformObj);
        //End CHAPTER17MOD
        }

    return;
    }







/*
 * CTenant::CreateStatic
 * (Protected)
 *
 * Purpose:
 *  Creates a new static bitmap or metafile object for this tenant
 *  using a freeloading method allowing us to specify exactly which
 *  type of data we want to paste since OleCreateStaticFromData
 *  doesn't.
 *
 * Parameters:
 *  pIDataObject    LPDATAOBJECT from which to paste.
 *  pFE             LPFORMATETC describing the format to paste.
 *  ppObj           LPUNKNOWN * into which we store the
 *                  object pointer.
 *
 * Return Value:
 *  HRESULT         NOERROR on success, error code otherwise.
 */

HRESULT CTenant::CreateStatic(LPDATAOBJECT pIDataObject
    , LPFORMATETC pFE, LPUNKNOWN *ppObj)
    {
    HRESULT             hr;
    STGMEDIUM           stm;
    LPUNKNOWN           pIUnknown;
    LPOLECACHE          pIOleCache;
    LPPERSISTSTORAGE    pIPersistStorage;
    CLSID               clsID;

    *ppObj=NULL;

    //Try to get the data desired as specified in pFE->cfFormat
    hr=pIDataObject->GetData(pFE, &stm);

    if (FAILED(hr))
        return hr;

    //Create the object to handle this data.
    if (CF_METAFILEPICT==pFE->cfFormat)
        clsID=CLSID_Picture_Metafile;
    else
        clsID=CLSID_Picture_Dib;

    hr=CreateDataCache(NULL, clsID, IID_IUnknown
        , (PPVOID)&pIUnknown);

    if (FAILED(hr))
        {
        ReleaseStgMedium(&stm);
        return hr;
        }

    m_clsID=clsID;

    //Stuff the data into the object
    pIUnknown->QueryInterface(IID_IPersistStorage
        , (PPVOID)&pIPersistStorage);
    pIPersistStorage->InitNew(m_pIStorage);

    //Now that we have the cache object, shove the data into it.
    pIUnknown->QueryInterface(IID_IOleCache, (PPVOID)&pIOleCache);
    pIOleCache->Cache(pFE, ADVF_PRIMEFIRST, NULL);

    hr=pIOleCache->SetData(pFE, &stm, TRUE);
    pIOleCache->Release();

    //Insure there is a persistent copy on the disk
    WriteClassStg(m_pIStorage, m_clsID);
    pIPersistStorage->Save(m_pIStorage, TRUE);
    pIPersistStorage->SaveCompleted(NULL);
    pIPersistStorage->Release();

    //The cache owns this now.
    ReleaseStgMedium(&stm);

    if (FAILED(hr))
        pIUnknown->Release();
    else
        *ppObj=pIUnknown;

    return hr;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美专区在线观看一区| 秋霞影院一区二区| 久久久www成人免费无遮挡大片| 在线观看欧美日本| 色系网站成人免费| 欧美亚洲综合色| 欧美日韩一区小说| 91精品欧美久久久久久动漫| 制服丝袜一区二区三区| 91精品国产高清一区二区三区 | 中文字幕日韩欧美一区二区三区| 国产日韩欧美在线一区| 国产精品私人影院| 综合自拍亚洲综合图不卡区| 亚洲在线视频网站| 日韩黄色片在线观看| 韩国av一区二区三区| 国产精品一区免费视频| 成人美女视频在线观看| 欧美这里有精品| 欧美一区三区二区| 久久久久久久一区| 亚洲天堂久久久久久久| 日韩二区三区四区| 韩国一区二区三区| 在线观看av一区二区| 欧美一区二区三区在线观看| 精品国产乱码91久久久久久网站| 中文字幕精品一区二区三区精品| 一区二区高清在线| 日韩中文字幕av电影| 精品一区二区三区久久| 91老司机福利 在线| 欧美美女网站色| 日韩三区在线观看| 欧美高清在线一区| 午夜精品久久久| 国产福利一区二区三区在线视频| 91免费看视频| 精品第一国产综合精品aⅴ| 亚洲视频在线观看一区| 蜜臀久久久久久久| 91视视频在线直接观看在线看网页在线看| 在线免费一区三区| 久久精品欧美一区二区三区麻豆| 亚洲一区二区黄色| 成人丝袜视频网| 欧美一卡二卡三卡四卡| 亚洲老司机在线| 丁香婷婷综合激情五月色| 欧美日韩小视频| 国产精品高清亚洲| 狠狠色狠狠色合久久伊人| 欧美性做爰猛烈叫床潮| 国产精品视频一二三| 黑人精品欧美一区二区蜜桃 | 日韩欧美精品在线| 亚洲欧美韩国综合色| 极品美女销魂一区二区三区免费 | 欧亚洲嫩模精品一区三区| 久久久久免费观看| 精品亚洲porn| 日韩免费高清视频| 麻豆国产欧美日韩综合精品二区| 欧美最猛性xxxxx直播| 亚洲日本乱码在线观看| 99久久777色| 国产精品毛片a∨一区二区三区| 国产一区二区不卡在线| 26uuu国产日韩综合| 日韩精品成人一区二区在线| 欧美日韩精品一区二区天天拍小说 | 国产乱码精品一区二区三区av| 欧美日韩精品一区二区三区蜜桃 | 丰满白嫩尤物一区二区| 精品国产乱子伦一区| 免费看欧美美女黄的网站| 欧美日韩电影在线播放| 五月天亚洲婷婷| 欧美久久婷婷综合色| 五月天国产精品| 亚洲成人动漫在线免费观看| 在线免费观看成人短视频| 亚洲综合偷拍欧美一区色| 色8久久精品久久久久久蜜| 综合激情成人伊人| 欧美性一级生活| 日韩精品视频网| 久久天堂av综合合色蜜桃网| 成人免费高清在线| 亚洲乱码中文字幕| 欧美日韩美女一区二区| 美国三级日本三级久久99 | 国产在线一区二区综合免费视频| 欧美白人最猛性xxxxx69交| 国产精品视频yy9299一区| 91网站最新地址| 日韩国产精品大片| 精品理论电影在线观看| 大桥未久av一区二区三区中文| 国产精品久久久久9999吃药| 欧美日本视频在线| 在线观看视频一区| 亚洲乱码中文字幕| 播五月开心婷婷综合| 国产精品1区2区| 成人免费在线视频观看| 麻豆精品国产91久久久久久| 日韩欧美黄色影院| 久久精品国产一区二区三区免费看| 久久久影视传媒| 欧美日本在线播放| 高清视频一区二区| 午夜精品一区二区三区免费视频 | 在线看国产日韩| 精品一区二区三区在线观看国产 | 欧美色中文字幕| 粉嫩在线一区二区三区视频| 免费精品99久久国产综合精品| 久久免费看少妇高潮| 91福利在线观看| 国产麻豆一精品一av一免费| 亚洲h在线观看| 国产精品网站在线| 日韩欧美一级二级| 欧美这里有精品| 成人午夜激情影院| 蜜桃av一区二区| 亚洲一区视频在线| 国产精品视频一二| 欧美成人猛片aaaaaaa| 91麻豆国产福利在线观看| 五月天网站亚洲| 一个色综合av| 亚洲欧美日韩中文播放| 国产日韩欧美高清在线| 欧美成人aa大片| 欧美午夜视频网站| 日本久久一区二区| 北条麻妃一区二区三区| 国产精一区二区三区| 精品制服美女久久| 美国精品在线观看| 麻豆精品新av中文字幕| 日韩精品欧美成人高清一区二区| 一区二区三区色| 国产精品色噜噜| 日本一区二区三区在线不卡| 精品国产免费久久| 国产婷婷一区二区| 国产视频一区二区在线| 久久五月婷婷丁香社区| 久久综合九色综合欧美98| 欧美精品三级在线观看| 91精品国产综合久久久久久久久久 | 国产高清久久久| 福利电影一区二区| 麻豆国产精品官网| 免费看精品久久片| 国产在线精品免费| 国产乱子伦视频一区二区三区 | 成人av手机在线观看| 日本不卡高清视频| 久久99日本精品| 亚洲视频中文字幕| 伊人开心综合网| 一区二区三区中文在线| 亚洲综合免费观看高清完整版在线 | 国产欧美一区二区在线观看| 一区二区三区国产精华| 成人av在线影院| 欧美一级高清大全免费观看| 国产精品毛片久久久久久| 欧美精品一区二区三| 日韩一卡二卡三卡| 欧美v日韩v国产v| 成人激情免费视频| 在线精品亚洲一区二区不卡| 欧日韩精品视频| 色综合久久久久综合体桃花网| 国产成人精品一区二区三区四区 | 岛国精品在线观看| 亚洲国产综合91精品麻豆| 亚洲视频在线观看三级| 亚洲综合成人在线视频| 亚洲高清视频的网址| 亚洲.国产.中文慕字在线| 精品国产91洋老外米糕| 国产精品久久一级| 欧美日韩一区 二区 三区 久久精品| 国产精品中文字幕欧美| 美女在线视频一区| 欧美国产综合一区二区| 国产精品丝袜一区| 国产精品欧美极品| 亚洲一级二级三级在线免费观看| 亚洲自拍偷拍九九九| 欧美一级高清片在线观看| 亚洲色图欧美在线| 中文字幕中文字幕一区二区|