Interface description (IDL)

www.altova.com このトピックを印刷 前のページ 1つ上のレベル 次のページ

ホーム >  プログラマーのレファレンス > 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 XMLSpy.

 

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 -----

 

 [

         odl,

         uuid(88F2A622-4B7E-42CD-8D04-3C0E5389DD85),

         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 -----

 

[

 uuid(24FE0D1B-3FC0-494E-B36E-1D4CE412B014),

 version(1.0),

 helpstring("XMLSpyIDEPlugInDLL 1.0 Type Library")

]

library XMLSPYIDEPLUGINDLLLib

{

 importlib("stdole32.tlb");

 importlib("stdole2.tlb");

 

 [

         uuid(3800E791-7F6B-4ACD-9E32-2AC184444501),

         helpstring("XMLSpyIDEPlugIn Class")

 ]

 coclass XMLSpyIDEPlugIn

 {

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

 };

};


(C) 2018 Altova GmbH