Altova Authentic 2025 Desktop

In the class definition of the ATL object, the following changes must be made:

 

The class has to derive from IXMLSpyPlugIn

The "Interface Map" needs an entry for IXMLSpyPlugIn

The methods of the IDE plug-in interface must be declared

 

These changes can be made as shown below:

 

 

#ifndef __XMLSPYIDEPLUGIN_H_

#define __XMLSPYIDEPLUGIN_H_

 

#include "resource.h"       // main symbols

 

/////////////////////////////////////////////////////////////////////////////

// CXMLSpyIDEPlugIn

class ATL_NO_VTABLE CXMLSpyIDEPlugIn :

  public CComObjectRootEx<CComSingleThreadModel>,

  public CComCoClass<CXMLSpyIDEPlugIn, &CLSID_XMLSpyIDEPlugIn>,

  public IXMLSpyPlugIn

{

public:

  CXMLSpyIDEPlugIn()

  {

  }

 

DECLARE_REGISTRY_RESOURCEID(IDR_XMLSPYIDEPLUGIN)

DECLARE_NOT_AGGREGATABLE(CXMLSpyIDEPlugIn)

 

DECLARE_PROTECT_FINAL_CONSTRUCT()

 

BEGIN_COM_MAP(CXMLSpyIDEPlugIn)

  COM_INTERFACE_ENTRY(IXMLSpyPlugIn)

END_COM_MAP()

 

// IXMLSpyIDEPlugIn

public:

  virtual HRESULT _stdcall OnCommand(long nID, IDispatch* pXMLSpy);

  virtual HRESULT _stdcall OnUpdateCommand(long nID, IDispatch* pXMLSpy, SPYUpdateAction* pAction);

  virtual HRESULT _stdcall OnEvent(long nEventID, SAFEARRAY **arrayParameters, IDispatch* pXMLSpy, VARIANT* pReturnValue);

  virtual HRESULT _stdcall GetUIModifications(BSTR* pModificationsXML);

  virtual HRESULT _stdcall GetDescription(BSTR* pDescription);

};

 

#endif //__XMLSPYIDEPLUGIN_H_

 

© 2018-2024 Altova GmbH