Interface description (IDL) Imprimer cette rubrique Page précédente Un niveau supérieur Page suivante

Accueil >  Programmers' Reference > IDE Plugins > ATL sample files >

Interface description (IDL)

The IDL of the newly created ATL object contains a declaration for one COM interface.


This interface declaration must be replaced by the declaration of IXMLSpyPlugIn as shown below.


The IDL must also contain the definition of the SPYUpdateAction enumeration.


Replace the generated default interface name, (created by the wizard) with "IXMLSpyPlugIn" in the coclass declaration. The IDL should then look something like the example code below:


Having created the ATL object, you then need to implement the IDE plug-in interface of Authentic Desktop.


import "oaidl.idl";

import "ocidl.idl";


// ----- please insert the following block into your IDL file -----

 typedef enum {

         spyEnable = 1,

         spyDisable = 2,

         spyCheck = 4,

         spyUncheck = 8

 } SPYUpdateAction;


// ----- end insert block ----



// ----- E.g. Interface entry automatically generated by the ATL wizard -----

//        [

//                        object,

//                        uuid(AB7CD86A-8145-429A-A1F3-270692EO8AFC),


//                        helpstring("IXMLSpyPlugIn Interface")

//                        pointer_default(unique)

//        ]

//        interface IXMLSpyPlugIn : IUnknown

//        {

//        };


// ----- end automatically generated Interface Entry



// ----- replace the Interface Entry (shown above) generated for you by the ATL wizard, with the following block -----





         helpstring("IXMLSpyPlugIn Interface")


 interface IXMLSpyPlugIn : IUnknown


                 HRESULT _stdcall OnCommand([in] long nID, [in] IDispatch* pXMLSpy);


                 HRESULT _stdcall OnUpdateCommand([in] long nID, [in] IDispatch* pXMLSpy, [out, retval] SPYUpdateAction* pAction);


                 HRESULT _stdcall OnEvent([in] long nEventID, [in] SAFEARRAY(VARIANT)* arrayParameters, [in] IDispatch* pXMLSpy, [out, retval] VARIANT* pReturnValue);


                 HRESULT _stdcall GetUIModifications([out, retval] BSTR* pModificationsXML);


                 HRESULT _stdcall GetDescription([out, retval] BSTR* pDescription);



// ----- end replace block -----



// ----- The code below is automatically generated by the ATL wizard and will look slightly different in your case -----





 helpstring("XMLSpyIDEPlugInDLL 1.0 Type Library")









         helpstring("XMLSpyIDEPlugIn Class")


 coclass XMLSpyIDEPlugIn


         [default] interface IXMLSpyPlugIn;   // ----- define IXMLSpyPlugIn as the default interface -----



© 2019 Altova GmbH