// Both.h : Declaration of the CBoth

#ifndef __BOTH_H_
#define __BOTH_H_

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CBoth
class ATL_NO_VTABLE CBoth : 
	public CComObjectRootEx<CComMultiThreadModel>,
	public CComCoClass<CBoth, &CLSID_MsjJavademoBoth>,
	public IDispatchImpl<IGetCurrentThreadID, &IID_IGetCurrentThreadID, &LIBID_THREADSVLib>
{
public:
	CBoth()
	{
		char out [256] ; 
		wsprintf (out, "Control created on thread %d", GetCurrentThreadId()) ;
		MessageBox (NULL, out, "Both", 0) ;
	}

DECLARE_REGISTRY_RESOURCEID(IDR_BOTH)

BEGIN_COM_MAP(CBoth)
	COM_INTERFACE_ENTRY(IGetCurrentThreadID)
	COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()

// IBoth
public:
	STDMETHOD(get_CurrentThreadId)(/*[out, retval]*/ long *pVal);
};

#endif //__BOTH_H_
