atldemo.idl
来自「VC.net 的一些有用的技巧」· IDL 代码 · 共 65 行
IDL
65 行
// ATLDemo.idl : ATLDemo 的 IDL 源
//
// 此文件将由 MIDL 工具处理以
// 产生类型库 (ATLDemo.tlb) 和封送处理代码。
#include "olectl.h"
import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(6EBCDAA9-3A67-4DE5-911F-92CA91F797BA),
dual,
nonextensible,
helpstring("IMyATLCtrl 接口"),
pointer_default(unique)
]
interface IMyATLCtrl : IDispatch{
[propput, bindable, requestedit, id(DISPID_FILLCOLOR)]
HRESULT FillColor([in]OLE_COLOR clr);
[propget, bindable, requestedit, id(DISPID_FILLCOLOR)]
HRESULT FillColor([out, retval]OLE_COLOR* pclr);
[propget, id(1), helpstring("属性 Sides")] HRESULT Sides([out, retval] SHORT* pVal);
[propput, id(1), helpstring("属性 Sides")] HRESULT Sides([in] SHORT newVal);
};
[
uuid(8838334E-38D5-4E22-A864-8E25674D7680),
version(1.0),
helpstring("ATLDemo 1.0 类型库")
]
library ATLDemoLib
{
importlib("stdole2.tlb");
[
uuid(83942E3E-1A8D-473E-9835-D140C9F90085),
helpstring("_IMyATLCtrl事件接口")
]
dispinterface _IMyATLCtrlEvents
{
properties:
methods:
[id(1), helpstring("方法ClickIn")] void ClickIn([in] LONG y, [in] LONG x);
[id(2), helpstring("方法ClickOut")] void ClickOut([in] LONG y, [in] LONG x);
};
[
uuid(5F0EA9A3-63DD-44FF-A15D-75916131033F),
helpstring("MyATLCtrl Class")
]
coclass MyATLCtrl
{
[default] interface IMyATLCtrl;
[default, source] dispinterface _IMyATLCtrlEvents;
};
[
uuid(E619DF38-533E-4693-A932-CD5D0DCE6E70),
helpstring("ATLDemoProp Class")
]
coclass ATLDemoProp
{
[default] interface IUnknown;
};
};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?