// interopechohdrObj.h : Declaration of the CinteropechohdrObj
//
// Copyright (c) 2002 Robert Cunnings. All rights reserved.
//
// You may copy, modify, distribute or publish this code free of charge.
//
// NO WARRANTY: This software is provided AS IS, without warranty of any kind.
//
//////////////////////////////////////////////////////////////////////
//
// CinteropechohdrObj class - implementation of header handler for 
// Round 2 interop "Group C" service.
// 
//////////////////////////////////////////////////////////////////////

#pragma once
#include "resource.h"       // main symbols

#include "interopechoheader.h"

#include "comdef.h"
#include <vector>
using namespace std;

// CinteropechohdrObj

class ATL_NO_VTABLE CinteropechohdrObj : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CinteropechohdrObj, &CLSID_interopechoheader>,
	public IDispatchImpl<Iinteropechoheader, &IID_Iinteropechoheader, &LIBID_interopechoheaderLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
{
public:
	CinteropechohdrObj()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_INTEROPECHOHDROBJ)


BEGIN_COM_MAP(CinteropechohdrObj)
	COM_INTERFACE_ENTRY(Iinteropechoheader)
	COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()


	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}
	
	void FinalRelease() 
	{
	}

public:
	STDMETHOD(OnProcessHeader)(/*[in]*/ VARIANT SOAPMsgInterface, /*[out, retval]*/ VARIANT_BOOL *pResult);
	STDMETHOD(OnTestMUHeaderBlock)(/*[in]*/ BSTR bstrNamespace, /*[in]*/ BSTR bstrLocalName, /*[out, retval]*/ VARIANT_BOOL *pResult);

	// storage for echoed values
	vector <_variant_t>  m_arrStringHeaders;
	vector <_variant_t>	 m_arrStructHeaders;
};

OBJECT_ENTRY_AUTO(__uuidof(interopechoheader), CinteropechohdrObj)
