// Single.h : Declaration of the CSingle

#ifndef __SINGLE_H_
#define __SINGLE_H_

#include "resource.h"       // main symbols

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

DECLARE_REGISTRY_RESOURCEID(IDR_SINGLE)

BEGIN_COM_MAP(CSingle)
	COM_INTERFACE_ENTRY(IGetCurrentThreadID)
	COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()

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

#endif //__SINGLE_H_
