bank.idl

来自「演示了在VC中如何生成和调用com程序,代码简洁,方便.」· IDL 代码 · 共 44 行

IDL
44
字号
// Bank.idl : IDL source for Bank.dll
//

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

import "oaidl.idl";
import "ocidl.idl";
	[
		object,
		uuid(EF327845-40A8-4AE0-9050-EA7FAD0275EA),
		dual,
		helpstring("IAccount Interface"),
		pointer_default(unique)
	]
	interface IAccount : IDispatch
	{
	
		[id(1), helpstring("method Deposit")] HRESULT Deposit([in]double x);
		[id(2), helpstring("method Withdraw")] HRESULT Withdraw([in]double x);
		[propget, id(3), helpstring("property CurrentAccount")] HRESULT CurrentAccount([out, retval] double *pVal);
		[propput, id(3), helpstring("property CurrentAccount")] HRESULT CurrentAccount([in] double newVal);
	};

[
	uuid(98ECF356-06EF-4F72-A3A0-6ECA3725509E),
	version(1.0),
	helpstring("Bank 1.0 Type Library")
]
library BANKLib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[
		uuid(EB914BA1-3C9C-4321-BB87-D2F8E3EFEB09),
		helpstring("Account Class")
	]
	coclass Account
	{
		[default] interface IAccount;
	};
};

⌨️ 快捷键说明

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