#include <activscp.h>

class  CScriptEngine : public IActiveScript, public IActiveScriptParse
{
     public:
       ULONG           m_RefCount;

		IActiveScriptSite *	m_pActiveSite ;
		SCRIPTSTATE		m_ss ;
		char *			m_pScriptText ;
          

        CScriptEngine  (void) ;
        ~CScriptEngine (void);

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

        //IActiveScript members

		STDMETHODIMP SetScriptSite(IActiveScriptSite *pass) ;
		STDMETHODIMP GetScriptSite(REFIID riid, void **ppvObject) ;
        STDMETHODIMP SetScriptState(SCRIPTSTATE ss) ;
        STDMETHODIMP GetScriptState(SCRIPTSTATE *pssState) ;
        STDMETHODIMP Close(void) ;
        STDMETHODIMP AddNamedItem(LPCOLESTR pstrName, DWORD dwFlags);
        STDMETHODIMP AddTypeLib(REFGUID rguidTypeLib, DWORD dwMajor, DWORD dwMinor, DWORD dwFlags) ;
        STDMETHODIMP GetScriptDispatch(LPCOLESTR pstrItemName, IDispatch **ppdisp) ;
        STDMETHODIMP GetCurrentScriptThreadID(SCRIPTTHREADID *pstidThread) ;
        STDMETHODIMP GetScriptThreadID(DWORD dwWin32ThreadId, SCRIPTTHREADID *pstidThread) ;
        STDMETHODIMP GetScriptThreadState(SCRIPTTHREADID stidThread, SCRIPTTHREADSTATE *pstsState) ;
        STDMETHODIMP InterruptScriptThread(SCRIPTTHREADID stidThread, const EXCEPINFO *pexcepinfo, DWORD dwFlags) ;
        STDMETHODIMP Clone(IActiveScript **ppscript) ;

		// IActiveScriptParse members

        virtual HRESULT __stdcall InitNew( void) ;
        
        virtual HRESULT __stdcall AddScriptlet(LPCOLESTR pstrDefaultName, LPCOLESTR pstrCode,
            LPCOLESTR pstrItemName, LPCOLESTR pstrSubItemName, LPCOLESTR pstrEventName,
            LPCOLESTR pstrDelimiter, DWORD dwSourceContextCookie, ULONG ulStartingLineNumber,
            DWORD dwFlags, BSTR *pbstrName, EXCEPINFO *pexcepinfo) ;
        
        virtual HRESULT __stdcall ParseScriptText(LPCOLESTR pstrCode, LPCOLESTR pstrItemName,
            IUnknown *punkContext, LPCOLESTR pstrDelimiter, DWORD dwSourceContextCookie,
            ULONG ulStartingLineNumber, DWORD dwFlags, VARIANT *pvarResult, EXCEPINFO *pexcepinfo) ;
        

 };

