mytime.odl

来自「Visual c++.程序设计培训教程」· ODL 代码 · 共 75 行

ODL
75
字号
// MyTime.odl : type library source for ActiveX Control project.

// This file will be processed by the Make Type Library (mktyplib) tool to
// produce the type library (MyTime.tlb) that will become a resource in
// MyTime.ocx.

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

[ uuid(AAB72D24-2A2B-11D6-9C7C-5254AB31B8A3), version(1.0),
  helpfile("MyTime.hlp"),
  helpstring("MyTime ActiveX Control module"),
  control ]
library MYTIMELib
{
	importlib(STDOLE_TLB);
	importlib(STDTYPE_TLB);

	//  Primary dispatch interface for CMyTimeCtrl

	[ uuid(AAB72D25-2A2B-11D6-9C7C-5254AB31B8A3),
	  helpstring("Dispatch interface for MyTime Control"), hidden ]
	dispinterface _DMyTime
	{
		properties:
			// NOTE - ClassWizard will maintain property information here.
			//    Use extreme caution when editing this section.
			//{{AFX_ODL_PROP(CMyTimeCtrl)
			[id(DISPID_BACKCOLOR), bindable, requestedit] OLE_COLOR BackColor;
			[id(DISPID_FORECOLOR), bindable, requestedit] OLE_COLOR ForeColor;
			//}}AFX_ODL_PROP

		methods:
			// NOTE - ClassWizard will maintain method information here.
			//    Use extreme caution when editing this section.
			//{{AFX_ODL_METHOD(CMyTimeCtrl)
			//}}AFX_ODL_METHOD

			[id(DISPID_ABOUTBOX)] void AboutBox();
	};

	//  Event dispatch interface for CMyTimeCtrl

	[ uuid(AAB72D26-2A2B-11D6-9C7C-5254AB31B8A3),
	  helpstring("Event interface for MyTime Control") ]
	dispinterface _DMyTimeEvents
	{
		properties:
			//  Event interface has no properties

		methods:
			// NOTE - ClassWizard will maintain event information here.
			//    Use extreme caution when editing this section.
			//{{AFX_ODL_EVENT(CMyTimeCtrl)
			[id(DISPID_CLICK)] void Click();
			[id(1)] void NewHour(short hour);
			[id(2)] void NewMinute();
			//}}AFX_ODL_EVENT
	};

	//  Class information for CMyTimeCtrl

	[ uuid(AAB72D27-2A2B-11D6-9C7C-5254AB31B8A3),
	  helpstring("MyTime Control"), control ]
	coclass MyTime
	{
		[default] dispinterface _DMyTime;
		[default, source] dispinterface _DMyTimeEvents;
	};


	//{{AFX_APPEND_ODL}}
	//}}AFX_APPEND_ODL}}
};

⌨️ 快捷键说明

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