xml spy
Previous  Top  Next
Interface description (IDL)

Having created the ATL object, you then need to implement the IDE plug-in interface of XMLSpy. The IDL file of the project contains a new entry for a coclass. Instead of using the predefined custom interface, you can insert the definition of the IXMLSpyPlugIn interface.

The IDL must also contain the definition of the SPYUpdateAction enumeration. Also, replace the generated interface name, (created by the wizard) with "IXMLSpyPlugIn" in the coclass declaration. The IDL should then look something like this:

import "oaidl.idl";
import
 "ocidl.idl";

   typedef
 enum {
      spyEnable = 1,
      spyDisable = 2,
      spyCheck = 4,
      spyUncheck = 8
   } SPYUpdateAction;

   [
      odl
,
      uuid
(88F2A622-4B7E-42CD-8D04-3C0E5389DD85),
   
   helpstring("IXMLSpyPlugIn Interface")
   ]
   interface
 IXMLSpyPlugIn : IUnknown
      {
         HRESULT _stdcall
 OnCommand([inlong nID, [in] IDispatch* pXMLSpy);

         HRESULT _stdcall
 OnUpdateCommand([inlong nID, [in] IDispatch* pXMLSpy, [outretval] SPYUpdateAction* pAction);

         HRESULT _stdcall
 OnEvent([inlong nEventID, [in] SAFEARRAY(VARIANT)* arrayParameters, [in] IDispatch* pXMLSpy, [outretval] VARIANT* pReturnValue);

         HRESULT _stdcall
 GetUIModifications([outretval] BSTR* pModificationsXML);

         HRESULT _stdcall
 GetDescription([outretval] BSTR* pDescription);
      };

 [
   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;
   };
};


Previous  Top  Next

© 2002 Altova