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

📄 xoffice.idl

📁 在程序里使用MS Office的例子,包括对word与excel文件的处理。
💻 IDL
字号:
// XOffice.idl : IDL source for XOffice.exe
//
// This file will be processed by the MIDL tool to
// produce the type library (XOffice.tlb) and marshalling code.
[
	uuid(04DE9790-E920-11D3-8D22-0000E8D9FD76),
	version(1.0),
        helpstring("XOffice 1.0 Type Library")
]
library XOfficeLib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");
	import "oaidl.idl";
	import "ocidl.idl";

	[
		object,
		uuid(CF97DAD3-E9D1-11D3-8D23-0000E8D9FD76),
		dual,
		helpstring("IDocument Interface"),
		pointer_default(unique)
	]
	interface IDocument : IDispatch
	{
		[propget, id(1), helpstring("property PStr")] HRESULT PStr([out, retval] BSTR *pVal);
		[propput, id(1), helpstring("property PStr")] HRESULT PStr([in] BSTR newVal);
		[propget, id(2), helpstring("property PDouble")] HRESULT PDouble([out, retval] double *pVal);
		[propput, id(2), helpstring("property PDouble")] HRESULT PDouble([in] double newVal);
		[propget, id(3), helpstring("property PLong")] HRESULT PLong([out, retval] long *pVal);
		[propput, id(3), helpstring("property PLong")] HRESULT PLong([in] long newVal);
	};

	[
		uuid(CF97DAD5-E9D1-11D3-8D23-0000E8D9FD76),
		helpstring("_IDocumentEvents Interface")
	]
	dispinterface _IDocumentEvents
	{
		properties:
		methods:
	};

	[
		uuid(CF97DAD4-E9D1-11D3-8D23-0000E8D9FD76),
		helpstring("Document Class")
	]
	coclass Document
	{
		[default] interface IDocument;
		[default, source] dispinterface _IDocumentEvents;
	};

	[
		object,
		uuid(04DE9792-E920-11D3-8D22-0000E8D9FD76),
		dual,
		helpstring("IApplication Interface"),
		pointer_default(unique)
	]
	interface IApplication : IDispatch
	{
		[propget, id(1), helpstring("property ActiveDocument")] HRESULT ActiveDocument([out, retval] IDocument* *pVal);
		[propget, id(2), helpstring("property IsActiveDocument")] HRESULT IsActiveDocument([out, retval] BOOL *pVal);
	};

	[
		uuid(04DE9794-E920-11D3-8D22-0000E8D9FD76),
		helpstring("_IApplicationEvents Interface")
	]
	dispinterface _IApplicationEvents
	{
		properties:
		methods:
	};

	[
		uuid(04DE9793-E920-11D3-8D22-0000E8D9FD76),
		helpstring("Application Class")
	]
	coclass Application
	{
		[default] interface IApplication;
		[default, source] dispinterface _IApplicationEvents;
	};
};


⌨️ 快捷键说明

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