把 enum 写到 typelib 定义文件中去
举例:(我自己编的控件代码)
// HoverButton.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 (HoverButton.tlb) that will become a resource in
// HoverButton.ocx.
#include <olectl.h>
#include <idispids.h>
[ uuid(A6B9C705-C1B5-11D2-AB5E-0000E82A9730), version(1.0),
helpfile("HoverButton.hlp"),
helpstring("HoverButton ActiveX Control module"),
control ]
library HOVERBUTTONLib
{
importlib(STDOLE_TLB);
importlib(STDTYPE_TLB);
methods:
// NOTE - ClassWizard will maintain method information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_METHOD(CHoverButtonCtrl)
//}}AFX_ODL_METHOD
[id(DISPID_ABOUTBOX)] void AboutBox();
};
// Event dispatch interface for CHoverButtonCtrl
[ uuid(A6B9C707-C1B5-11D2-AB5E-0000E82A9730),
helpstring("Event interface for HoverButton Control") ]
dispinterface _DHoverButtonEvents
{
properties:
// Event interface has no properties
methods:
// NOTE - ClassWizard will maintain event information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_EVENT(CHoverButtonCtrl)
[id(DISPID_CLICK)] void Click();
[id(DISPID_DBLCLICK)] void DblClick();
//}}AFX_ODL_EVENT
};