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

📄 simple11.idl

📁 Thinkinc++English 电子书籍,英文版
💻 IDL
字号:
// Simple11.idl : IDL source for Simple11.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (Simple11.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";
////////////////////// ICallBack 接口的IDL声明需要手工输入 /////////////////////////
	[
		object,
		uuid(7E659BB1-FB79-4188-9661-65CA22B6A3E6),	// 这个 IID 可以用 GUDIGEN.EXE 产生
	
		helpstring("ICallBack Interface"),
		pointer_default(unique)
	]
	interface ICallBack : IUnknown
	{
		// 接口函数可以手工输入
		// 也可以在 ClassView 上,鼠标右键点接口名后在弹出菜单上,用Add Method输入
		[helpstring("method Fire_Result")] HRESULT Fire_Result([in] long nResult);
	};
////////////////////////////////////////////////////////////////////////////////////
	[
		object,
		uuid(7E659BB0-FB79-4188-9661-65CA22B6A3E6),
	
		helpstring("IEvent1 Interface"),
		pointer_default(unique)
	]
	interface IEvent1 : IUnknown
	{
		[helpstring("method Add")] HRESULT Add([in] long n1, [in] long n2);
		[helpstring("method Advise")] HRESULT Advise([in] ICallBack * pCallBack, [out] long * pdwCookie);
		[helpstring("method Unadvise")] HRESULT Unadvise([in] long dwCookie);
	};

[
	uuid(695C9BB2-2AE9-4232-8225-17AB8BD3BABC),
	version(1.0),
	helpstring("Simple11 1.0 Type Library")
]
library SIMPLE11Lib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[
		uuid(6FCF997C-C811-49DB-9D16-46FAF8D24822),
		helpstring("Event1 Class")
	]
	coclass Event1
	{
		[default] interface IEvent1;
		[source, default] interface ICallBack;	// 需要手工输入,据说 VB 使用的话,不能有 [source,default] 属性
	};
};

⌨️ 快捷键说明

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