An example of the com dll simpleatldll. IDL syntax
// Simpleatldll. IDL: The IDL source of simpleatldll
//
// This file will be processed by the midl Tool
// Generate the Type Library (simpleatldll. TLB) and the sending and processing code.
Import "oaidl. IDL ";
Import "ocidl. IDL ";
// --------------------- Rytype Enumeration type
// Object,
// UUID (05643780-af84-4073-9117-a033923f4bcb ),
// Pointer_default (unique)
Typedef
[
UUID (05643780-af84-4073-9117-a033923f4bcb ),
V1_enum,
Helpstring ("xprytype Enum ")
]
Enum enumxprytype {
Xprynull = 0,
Xprypoint = 1,
Xprymultipoint = 2,
Xprypolyline = 3,
Xprypolygon = 4,
Xpryenvelope = 5,
Xprypath = 6,
Xpryany = 7,
Xprymultipatch = 9,
Xpryring = 11,
Xpryline = 13,
Xprycirculararc = 14,
Xprybezier3curve = 15,
Xpryellipticarc = 16,
Xprybag = 17,
Xprytrianglestrip = 18,
Xprytrianglefan = 19,
Xpryray = 20,
Xprysphere = 21,
Xprytriangles = 22,
} Enumxprytype;
// --------------------- Enum Test
Typedef
[
UUID (F42ABD57-ECE8-42BF-AABF-E43FB0EF3933 ),
V1_enum,
Helpstring ("Enum test ")
]
Enum enumworkdays {
[Helpstring ("Monday")] Monday = 2,
[Helpstring ("Tuesday")] Tuesday = 3,
[Helpstring ("Wednesday")] Wednesday = 4,
[Helpstring ("Thursday")] Thursday = 5,
[Helpstring ("Friday")] Friday = 6
} Enumworkdays;
// --------------------- Tagimagefmt
Typedef
[
UUID (F1A3AFB8-EC53-4bc9-A0D7-5F91D65BCACB ),
Version (1.0 ),
Helpstring ("tagimagefmt Enum type ")
]
Enum enumimagefmt
{
[Helpstring ("TIF")] if_tiff = 0,
[Helpstring ("BMP")] if_bmp = 1,
} Imagefmt;
// ---------------- System-defined interface isimpleatlclass
[
Object,
UUID (FDE36D69-0004-46B3-90A3-AC9681D9B289 ),
Dual,
Nonextensible,
Helpstring ("isimpleatlclass interface "),
Pointer_default (unique)
]
Interface isimpleatlclass: idispatch {// idispatch/iunknown
// Define the addition method
Hresult add ([in] Long A, [in] Long B, [out, retval] Long * pnval );
};
[
Object,
UUID (6f4b7079-5e64-45af-b127-231dc081716a ),
Dual,
Nonextensible,
Helpstring ("isecendatl interface "),
Pointer_default (unique)
]
Interface isecendatl: idispatch // iunknown
{
// Define the addition method
[ID (1), helpstring ("Method Add")]
Hresult add ([in] Long A, [in] Long B, [out, retval] Long * pnval );
//-------------
[ID (2), helpstring ("method Sub")]
Hresult sub ([in] Long A, [in] Long B, [out, retval] Long * pnval );
};
// ---------------- Custom interface imathe
//[
// Object,
// UUID (CFA4D945-B4C7-46CE-88F6-7724F43A614A ),
// Dual,
// Nonextensible,
// Helpstring ("imathe interface "),
// Pointer_default (unique)
//]
// Interface imathe: iunknown
//{
// [Helpstring ("Method Add")]
// Hresult add ([in] Long N1, [in] Long N2, [out, retval] Long * pnval );
//};
//----------------
//---------------------------------------------
[
UUID (35b84547-5983-4781-8761-71d5eb474079 ),
Version (1.0 ),
Helpstring ("simpleatldll 2.0 Type Library "),
]
Library simpleatldlllib
{
Importlib ("stdole2.tlb ");
//----------------
/*[
UUID (666f0945-d7d2-4a74-a0e9-351e459a5910 ),
Helpstring ("xprytype Enum ")
]
Enum xprytype
{
[Default] Enum xprytype;
};*/
//--------------
[
UUID (958a3544-cd9d-408a-9859-3271f168c0a4 ),
Helpstring ("simpleatlclass class ")
]
Coclass simpleatlclass
{
[Default] interface isimpleatlclass;
Interface isecendatl;
};
Enum enumxprytype;
Enum enumworkdays;
Enum enumimagefmt;
//--------------
};
//------------------------------