#include <windows.h>
#include "ieliza.h"

/*
Class ID for client-side stub
*/

// {402F6BD0-CB37-11ce-849C-CA8DF39C7D1B}
static const GUID CLSID_ElizaProxy = 
{ 0x402f6bd0, 0xcb37, 0x11ce, { 0x84, 0x9c, 0xca, 0x8d, 0xf3, 0x9c, 0x7d, 0x1b } };



class  CElizaServer : public IEliza, IMarshal
{
    protected:
        ULONG           m_RefCount ;

    public:
   		HWND			m_hWnd ;
		HWND 			m_hEdit ;

		TCHAR 	m_ShareName [128] ;
		HANDLE 	m_hMap ;
		HANDLE 	m_hComplaintEvent ;
		HANDLE	m_hResponseEvent ;
		HANDLE 	m_hThread ;
		LPTSTR	m_pSharedMem ;
		DWORD 	m_ThreadID ;

		CElizaServer  (LPOLESTR);
        ~CElizaServer (void);

        //IUnknown members

        STDMETHODIMP         QueryInterface(REFIID, LPVOID*);
        STDMETHODIMP_(ULONG) AddRef(void);
        STDMETHODIMP_(ULONG) Release(void);

        //IEliza members
        STDMETHODIMP         Complain (LPOLESTR, LPOLESTR);

		// IMarshal members

  		STDMETHODIMP GetUnmarshalClass (REFIID, VOID*, DWORD, VOID*, DWORD, CLSID *) ;
  		STDMETHODIMP GetMarshalSizeMax (REFIID, VOID*, DWORD, VOID*, DWORD, DWORD *) ;
	  	STDMETHODIMP MarshalInterface (IStream *, REFIID , VOID * , DWORD, VOID *, DWORD) ;
  		STDMETHODIMP UnmarshalInterface (IStream *, REFIID, VOID **) ;
  		STDMETHODIMP ReleaseMarshalData (IStream * ) ;
  		STDMETHODIMP DisconnectObject ( DWORD ) ;


    };
