⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 olefile.c

📁 英文版的 想要的话可以下载了 为大家服务
💻 C
字号:
/*
 * OLEFILE.C
 *
 * Functions for handling special case OLE functions for operations
 * on a File menu such as New, Open, Save, SaveAs, and Exit.
 *
 * Functions:
 *  PDocRevokeAndCreate
 *
 * Copyright(c) Microsoft Corp. 1992-1994 All Rights Reserved
 * Win32 version, January 1994
 */

#ifdef MAKEOLESERVER

#include <windows.h>
#include <ole.h>
#include "cosmo.h"
#include "oleglobl.h"



/*
 * PDocRevokeAndCreate
 *
 * Purpose:
 *  Standard sequence of calling OleRevokeServerDoc, allocating and
 *  initializing a new OLESERVERDOC structure, and calling
 *  OleRegisterServerDoc.
 *
 * Parameters:
 *  pOLE            LPXOLEGLOBALS pointer to OLE global variables.
 *
 * Return Value:
 *  LPCOSMODOC      Pointer to the new document, or NULL if it fails.
 *
 */

LPCOSMODOC WINAPI PDocRevokeAndCreate(LPXOLEGLOBALS pOLE)
    {
    LPCOSMODOC      pDoc;
    OLESTATUS       os;

    os=OleRevokeServerDoc(pOLE->pSvr->pDoc->lh);

    /*
     * Even through we are revoking the document, the server will also
     * be Released (through not revoked) since no OLE connections will
     * exist to the server.  Since ServerRelease in this application
     * frees the allocated document, we need to wait until we pass
     * ServerRelease before allocating a new document.  Otherwise we'd
     * allocate a new one and ServerRelease would immediately free it.
     *
     * So in calling FOLEReleaseWait we watch the server's fRelease flag.
     */

    if (OLE_WAIT_FOR_RELEASE==os)
        {
        pOLE->pSvr->fRelease=FALSE;
        FOLEReleaseWait(&pOLE->pSvr->fRelease, pOLE->pSvr->lh);
        }

    pDoc=PDocumentAllocate(&pOLE->vtblDoc);
    pOLE->pSvr->pDoc=pDoc;

    if (NULL==pDoc)
        return NULL;

    os=OleRegisterServerDoc(pOLE->pSvr->lh, pGlob->szFile,
                            (LPOLESERVERDOC)pOLE->pSvr->pDoc,
                            &pOLE->pSvr->pDoc->lh);

    pOLE->pSvr->fLink=FALSE;
    pOLE->pSvr->fEmbed=FALSE;

    MenuEmbeddingSet(pGlob->hWnd, NULL, FALSE);
    return pDoc;
    }


#endif //MAKEOLESERVER

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -