📄 ole2.h
字号:
//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992-1999.
//
// File: OLE2.h
// Contents: Main OLE2 header; Defines Linking and Emmebbeding interfaces, and API's.
// Also includes .h files for the compobj, and oleauto subcomponents.
//
//----------------------------------------------------------------------------
#if !defined( _OLE2_H_ )
#pragma option push -b -a8 -pc -A- /*P_O_Push*/
#define _OLE2_H_
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _MAC
// Set packing to 8
#include <pshpack8.h>
// Make 100% sure WIN32 is defined
#ifndef WIN32
#define WIN32 100 // 100 == NT version 1.0
#endif
#else //_MAC
#ifdef _WIN32
#include "macname1.h"
#endif // _WIN32
#endif //_MAC
// SET to remove _export from interface definitions
#include <winerror.h>
#ifdef _MAC
#if !defined(__MACPUB__)
#include <macpub.h>
#endif
#endif //_MAC
#include <objbase.h>
#include <oleauto.h>
// View OBJECT Error Codes
#define E_DRAW VIEW_E_DRAW
// IDataObject Error Codes
#define DATA_E_FORMATETC DV_E_FORMATETC
#ifdef _MAC
/****** Standard Object Definitions *****************************************/
//#ifndef __COMPOBJ__
//#include <compobj.h>
//#endif
typedef enum {
OLE_E_NOEXTENSION = OLE_E_NOSTORAGE +1, // no extension at startup
OLE_E_VERSEXTENSION, // extension has wrong version #
OLE_E_IPBUSY, // cannot get inplace resource
OLE_E_NOT_FRONT_PROCESS, // inplace container unexpectedly in background
OLE_E_WRONG_MENU, // holemenu != prev holemenu
OLE_E_MENU_NOT_PATCHED, // menubar is not hashed
OLE_E_MENUID_NOT_HASHED, // id was never hashed
OLE_E_foo
} inplace_errors;
// DoDragDropMac()
typedef struct tagDRAG_FLAVORINFO {
unsigned long cfFormat;
unsigned long FlavorFlags; // Flavor Flags as specified by the DragManager
OLEBOOL fAddData; // If true, the data is added with the flavor
long reserved; // must be NULL
} DRAG_FLAVORINFO;
#endif //_MAC
// Common stuff gleamed from OLE.2,
/* verbs */
#define OLEIVERB_PRIMARY (0L)
#define OLEIVERB_SHOW (-1L)
#define OLEIVERB_OPEN (-2L)
#define OLEIVERB_HIDE (-3L)
#define OLEIVERB_UIACTIVATE (-4L)
#define OLEIVERB_INPLACEACTIVATE (-5L)
#define OLEIVERB_DISCARDUNDOSTATE (-6L)
// for OleCreateEmbeddingHelper flags; roles in low word; options in high word
#define EMBDHLP_INPROC_HANDLER 0x0000L
#define EMBDHLP_INPROC_SERVER 0x0001L
#define EMBDHLP_CREATENOW 0x00000000L
#define EMBDHLP_DELAYCREATE 0x00010000L
/* extended create function flags */
#define OLECREATE_LEAVERUNNING 0x00000001
/* pull in the MIDL generated header */
#include <oleidl.h>
#ifdef _MAC
typedef struct tagOleMBarRec
{
long reserved;
} OleMBarRec, *OleMBarPtr, **OleMBarHandle;
#define noAxis 3 // indicates no grow or size in any direction
// see mac #defines noConstraint, hAxisOnly, vAxisOnly
#endif //_MAC
/****** DV APIs ***********************************************************/
WINOLEAPI CreateDataAdviseHolder(OUT LPDATAADVISEHOLDER FAR* ppDAHolder);
/****** OLE API Prototypes ************************************************/
WINOLEAPI_(DWORD) OleBuildVersion( VOID );
/* helper functions */
WINOLEAPI ReadClassStg(IN LPSTORAGE pStg, OUT CLSID FAR* pclsid);
WINOLEAPI WriteClassStg(IN LPSTORAGE pStg, IN REFCLSID rclsid);
WINOLEAPI ReadClassStm(IN LPSTREAM pStm, OUT CLSID FAR* pclsid);
WINOLEAPI WriteClassStm(IN LPSTREAM pStm, IN REFCLSID rclsid);
WINOLEAPI WriteFmtUserTypeStg (IN LPSTORAGE pstg, IN CLIPFORMAT cf, IN LPOLESTR lpszUserType);
WINOLEAPI ReadFmtUserTypeStg (IN LPSTORAGE pstg, OUT CLIPFORMAT FAR* pcf, OUT LPOLESTR FAR* lplpszUserType);
/* init/term */
WINOLEAPI OleInitialize(IN LPVOID pvReserved);
WINOLEAPI_(void) OleUninitialize(void);
/* APIs to query whether (Embedded/Linked) object can be created from
the data object */
WINOLEAPI OleQueryLinkFromData(IN LPDATAOBJECT pSrcDataObject);
WINOLEAPI OleQueryCreateFromData(IN LPDATAOBJECT pSrcDataObject);
/* Object creation APIs */
WINOLEAPI OleCreate(IN REFCLSID rclsid, IN REFIID riid, IN DWORD renderopt,
IN LPFORMATETC pFormatEtc, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateEx(IN REFCLSID rclsid, IN REFIID riid, IN DWORD dwFlags,
IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateFromDataEx(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLinkFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLinkFromDataEx(IN LPDATAOBJECT pSrcDataObj, IN REFIID riid,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT IN DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateStaticFromData(IN LPDATAOBJECT pSrcDataObj, IN REFIID iid,
IN DWORD renderopt, IN LPFORMATETC pFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg,
OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLink(IN LPMONIKER pmkLinkSrc, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC lpFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLinkEx(IN LPMONIKER pmkLinkSrc, IN REFIID riid,
IN DWORD dwFlags, IN DWORD renderopt, IN ULONG cFormats, IN DWORD* rgAdvf,
IN LPFORMATETC rgFormatEtc, IN IAdviseSink FAR* lpAdviseSink,
OUT DWORD FAR* rgdwConnection, IN LPOLECLIENTSITE pClientSite,
IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
WINOLEAPI OleCreateLinkToFile(IN LPCOLESTR lpszFileName, IN REFIID riid,
IN DWORD renderopt, IN LPFORMATETC lpFormatEtc,
IN LPOLECLIENTSITE pClientSite, IN LPSTORAGE pStg, OUT LPVOID FAR* ppvObj);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -