function getdocversionstring(out version: tbstr): hresult; stdcall;
// hresult onscriptterminate(
// [in] const variant *pvarresult,
// [in] const excepinfo *pexcepinfo);
// called by the script engine when the script terminates. in most cases
// this method is not called, as it is possible that the parsed script may
// be used to dispatch events from the host application
function onscriptterminate(const pvarresult: olevariant; const pexcepinfo: texcepinfo): hresult; stdcall;
// hresult onstatechange(
// [in] scriptstate ssscriptstate);
// called by the script engine when state changes either explicitly via
// setscriptstate or implicitly via other script engine events.
function onstatechange(scriptstate: tscriptstate): hresult; stdcall;
// hresult onscripterror(
// [in] iactivescripterror *pscripterror);
// called when script execution or parsing encounters an error. the script
// engine will provide an implementation of iactivescripterror that
// describes the runtime error in terms of an excepinfo in addition to
// indicating the location of the error in the original script text.
function onscripterror(const pscripterror: iactivescripterror): hresult; stdcall;
// hresult onenterscript(void);
// called by the script engine to indicate the beginning of a unit of work.
function onenterscript: hresult; stdcall;
// hresult onleavescript(void);
// called by the script engine to indicate the completion of a unit of work.
function onleavescript: hresult; stdcall;
end; //iactivescriptsite interface
iactivescriptsitewindow = interface(iunknown)
['{d10f6761-83e9-11cf-8f20-00805f2cd064}']
// hresult getwindow(
// [out] hwnd *phwnd);
function getwindow(out handle: hwnd): hresult; stdcall;
// hresult enablemodeless(
// [in] bool fenable);
function enablemodeless(fenable: bool): hresult; stdcall;
end; //iactivescriptsitewindow interface
iactivescript = interface(iunknown)
['{bb1a2ae1-a4f9-11cf-8f20-00805f2cd064}']
// hresult setscriptsite(
// [in] iactivescriptsite *pass);
// conects the host's application site object to the engine
function setscriptsite(activescriptsite: iactivescriptsite): hresult; stdcall;
// hresult getscriptsite(
// [in] refiid riid,
// [iid_is][out] void **ppvobject);
// queries the engine for the connected site
function getscriptsite(riid: tguid; out oleobject: pointer): hresult; stdcall;
// hresult setscriptstate(
// [in] scriptstate ss);
// causes the engine to enter the designate state
function setscriptstate(state: tscriptstate): hresult; stdcall;
// hresult getscriptstate(
// [out] scriptstate *pssstate);
// queries the engine for its current state
function getscriptstate(out state: tscriptstate): hresult; stdcall;
// hresult close(void);
// forces the engine to enter the closed state, resetting any parsed scripts
// and disconnecting/releasing all of the host's objects.
function close: hresult; stdcall;
// hresult addnameditem(
// [in] lpcolestr pstrname,
// [in] dword dwflags);
// adds a variable name to the namespace of the script engine. the engine
// will call the site's getiteminfo to resolve the name to an object.
function addnameditem(name: polestr; flags: dword): hresult; stdcall;
// hresult addtypelib(