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

📄 clock.idl

📁 《Visual C++.NET MFC类库应用详解》程序实例
💻 IDL
字号:
// Clock.idl : ActiveX 控件项目的类型库源。

// 此文件将由 MIDL 编译器工具处理以
//产生类型库 (Clock.tlb),该类型库将成为 
// Clock.ocx 中的资源。

#include <olectl.h>
#include <idispids.h>

[ uuid(56104D15-485F-4636-9FB8-E2149467C250), version(1.0),
  helpfile("Clock.hlp"),
  helpstring("Clock ActiveX 控件模块"),
  control ]
library ClockLib
{
	importlib(STDOLE_TLB);

	//  CClockCtrl 的主调度接口

	[ uuid(8B547525-468E-451E-9875-69FE9910BED6),
	  helpstring("Clock Control 的调度接口")]
	dispinterface _DClock
	{
		properties:
		[id(DISPID_BACKCOLOR), helpstring("属性 BackColor")] OLE_COLOR BackColor;
		[id(DISPID_FORECOLOR), helpstring("属性 ForeColor")] OLE_COLOR ForeColor;
		[id(1), helpstring("属性 hourPosColor")] OLE_COLOR hourPosColor;
		[id(2), helpstring("属性 PenWidth")] SHORT PenWidth;
		[id(3), helpstring("属性 FactoryName")] BSTR FactoryName;
methods:

			[id(DISPID_ABOUTBOX)] void AboutBox();
			[id(4), helpstring("方法StartTimeKeeper")] void StartTimeKeeper(void);
			[id(5), helpstring("方法KillTimekeeper")] LONG KillTimekeeper(void);
			[id(6), helpstring("方法SetActiveTime")] void SetActiveTime(SHORT hour, SHORT min, SHORT sec);
	};

	//  CClockCtrl 的事件调度接口

	[ uuid(893DFA19-866C-4D2C-9BB1-8FC92233693B),
	  helpstring("Clock Control 的事件接口") ]
	dispinterface _DClockEvents
	{
		properties:
			//  事件接口没有任何属性

		methods:
		[id(DISPID_CLICK)] void Click(void);
		[id(DISPID_DBLCLICK)] void DblClick(void);
		[id(DISPID_KEYDOWN)] void KeyDown(SHORT* KeyCode, SHORT Shift);
		[id(DISPID_KEYPRESS)] void KeyPress(SHORT* KeyAscii);
		[id(DISPID_KEYUP)] void KeyUp(SHORT* KeyCode, SHORT Shift);
		[id(DISPID_MOUSEDOWN)] void MouseDown(SHORT Button, SHORT Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
		[id(DISPID_MOUSEMOVE)] void MouseMove(SHORT Button, SHORT Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
		[id(DISPID_MOUSEUP)] void MouseUp(SHORT Button, SHORT Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
		[id(DISPID_ERROREVENT)] void Error(SHORT Number, BSTR* Description, SCODE Scode, BSTR Source, BSTR HelpFile, LONG HelpContext, VARIANT_BOOL* CancelDisplay);
		[id(1)] void ActiveWhen(SHORT hour, SHORT min, SHORT sec);
	};

	//  CClockCtrl 的类信息

	[ uuid(704186E9-470C-480C-9036-D309B9B7ACCF),
	  helpstring("Clock Control"), control ]
	coclass Clock
	{
		[default] dispinterface _DClock;
		[default, source] dispinterface _DClockEvents;
	};

};

⌨️ 快捷键说明

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