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

📄 test07.idl

📁 使用方法如下: 1、在工程中加入comm.h这个头文件 2、在stdafx.h中加入 #include 3、在聚合类改变方法如下: 原句:public IDispatchImpl 新句:public
💻 IDL
字号:
// test07.idl : IDL source for test07.dll
//

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

import "oaidl.idl";
import "ocidl.idl";
	[
		object,
		uuid(E8DECB7F-93DE-4A6F-A95B-18A46AFDD540),
		dual,
		helpstring("IUser Interface"),
		pointer_default(unique)
	]
	interface IUser : IDispatch
	{
		[propget, id(1), helpstring("property Name")] HRESULT Name([out, retval] BSTR *pVal);
		[propput, id(1), helpstring("property Name")] HRESULT Name([in] BSTR newVal);
	};
	[
		object,
		uuid(6513E9E8-DAB4-4B70-AD39-93CFDEE8E971),
		dual,
		helpstring("IUsers Interface"),
		pointer_default(unique)
	]
	interface IUsers : IDispatch
	{
		[id(DISPID_NEWENUM), propget, helpstring("枚举接口")] HRESULT _NewEnum([out, retval] IUnknown** ppUnk);
		[id(DISPID_VALUE), propget, helpstring("第Index个子要素")] HRESULT Item([in] long Index, [out, retval] IUser** pVal);
		[id(3), helpstring("方法Add")] HRESULT Add([in] IUser* pUser);
		[id(4), helpstring("method RemoveAll")] HRESULT RemoveAll();
	};

[
	uuid(4E8C46AD-1767-4A16-AD2B-08962AFDCDCD),
	version(1.0),
	helpstring("test07 1.0 Type Library")
]
library TEST07Lib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[
		uuid(ED481D93-47F4-407C-960D-7C7F55CBA2A6),
		helpstring("Users Class")
	]
	coclass Users
	{
		[default] interface IUsers;
	};
	[
		uuid(A1559272-6E8D-441C-B0BB-C73167504CE4),
		helpstring("User Class")
	]
	coclass User
	{
		[default] interface IUser;
	};
};

⌨️ 快捷键说明

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