打印本文 打印本文 关闭窗口 关闭窗口
AXScript.pas,从官方站点找到的IActivsScript接口
作者:武汉SEO闵涛  文章来源:敏韬网  点击数1879  更新时间:2009/4/23 18:34:01  文章录入:mintao  责任编辑:mintao

{unti AXScript v.1.0 05/28/97 - converted header file for Microsoft ActiveScript.

Original conversion of the ActiveScript header by David Zajac (dzajac@HiWAAY.net)
for Delphi 2.x.

Modified by Brian Dupras (bdupras@dimensional.com) for Delphi 3.0 using interfaces
instead of classes (which was necessary for D2).

This unit is released to the public.  No warrenty or guarentee of *anything*
is expressed or implied.  Use this code at your own risk - any damage is your
own fault for trusting me.  If you find any error in this code, fix it.  If
you''''re nice, let me know about the error so I can fix it, too.

This code has to date (May 28, 1997) only been tested for creating a host for
ActiveScript.  I have not tried creating a scripting engine with it (and probably
never will).  But I''''ve been able to host both MS JScript and MS VBScript.

Good luck,
    Brian Dupras  5/28/97

----------------------------------------------------------------------------------

Ahh..updates.  I''''ve updated this unit slilghtly, and created a helper unit called
(and aptly so) AXScriptHelp.  The only major additions were those to support
MS IE4.  The other updates to this unit were minor - a few slight type differences
and some parameter name changes.  Mostly cosmetic stuff.

Again, Good luck,

Brian 7/6/97


By the way, JScript, VBScript and ActiveScript are registered trademarks of
Microsoft Corporation.


----------------------------------------------------------------------------------
More updates still.  Thank you Gary Warren King for noticing that I''''m an idiot.

The identifiers : SCRIPTTHREADID_CURRENT, SCRIPTTHREADID_BASE, and
SCRIPTTHREADID_ALL were originally thought to be C++ MACROS.  Upon second look,
however, they''''re not macros, they''''re #define constants that typcast the values
-1, -2, and -3 to the #typdef SCRIPTTHREADID.  Looking into another''''s activescript
conversion confirmed this, so the change has been made and duely noted.

We''''ll call this version 1.1 of the ActivScp.h conversion. 

Brian Dupras  8/26/97


p.s.  At the time of this writing, a slightly older demo using this header is
available at the Delphi Super Page.  The URL is
http://SunSITE.icm.edu.pl/delphi/, and the file is axscpd1.zip.  It can be
found under Delphi 3, Apps With Sources.  I plan to pust axscpd2.zip real soon
now, so get that one if it''''s there.
}


unit AXScript;

interface

uses
  Windows, ActiveX;


const
  //Category IDs
  CATID_ActiveScript:TGUID=              ''''{F0B7A1A1-9847-11cf-8F20-00805F2CD064}'''';
  CATID_ActiveScriptParse:TGUID=         ''''{F0B7A1A2-9847-11cf-8F20-00805F2CD064}'''';

  //Interface IDs
  IID_IActiveScriptSite:TGUID=           ''''{DB01A1E3-A42B-11cf-8F20-00805F2CD064}'''';
  IID_IActiveScriptSiteWindow:TGUID=     ''''{D10F6761-83E9-11cf-8F20-00805F2CD064}'''';
  IID_IActiveScript:TGUID=               ''''{BB1A2AE1-A4F9-11cf-8F20-00805F2CD064}'''';
  IID_IActiveScriptParse:TGUID=          ''''{BB1A2AE2-A4F9-11cf-8F20-00805F2CD064}'''';
  IID_IActiveScriptParseProcedure:TGUID= ''''{1CFF0050-6FDD-11d0-9328-00A0C90DCAA9}'''';
  IID_IActiveScriptError:TGUID=          ''''{EAE1BA61-A4ED-11cf-8F20-00805F2CD064}'''';


   // Constants used by ActiveX Scripting:
   SCRIPTITEM_ISVISIBLE     = $00000002;
   SCRIPTITEM_ISSOURCE      = $00000004;
   SCRIPTITEM_GLOBALMEMBERS = $00000008;
   SCRIPTITEM_ISPERSISTENT  = $00000040;
   SCRIPTITEM_CODEONLY      = $00000200;
   SCRIPTITEM_NOCODE        = $00000400;
   SCRIPTITEM_ALL_FLAGS     = (SCRIPTITEM_ISSOURCE or
                               SCRIPTITEM_ISVISIBLE or
                               SCRIPTITEM_ISPERSISTENT or
                               SCRIPTITEM_GLOBALMEMBERS or
                               SCRIPTITEM_NOCODE or
                               SCRIPTITEM_CODEONLY);

   // IActiveScript::AddTypeLib() input flags

   SCRIPTTYPELIB_ISCONTROL    = $00000010;
   SCRIPTTYPELIB_ISPERSISTENT = $00000040;
   SCRIPTTYPELIB_ALL_FLAGS    = (SCRIPTTYPELIB_ISCONTROL or
                                 SCRIPTTYPELIB_ISPERSISTENT);

// IActiveScriptParse::AddScriptlet() and IActiveScriptParse::ParseScriptText() input flags */

   SCRIPTTEXT_DELAYEXECUTION    = $00000001;
   SCRIPTTEXT_ISVISIBLE         = $00000002;
   SCRIPTTEXT_ISEXPRESSION      = $00000020;
   SCRIPTTEXT_ISPERSISTENT      = $00000040;
   SCRIPTTEXT_HOSTMANAGESSOURCE = $00000080;
   SCRIPTTEXT_ALL_FLAGS         = (SCRIPTTEXT_DELAYEXECUTION or
                                   SCRIPTTEXT_ISVISIBLE or
                                   SCRIPTTEXT_ISEXPRESSION or
                                   SCRIPTTEXT_HOSTMANAGESSOURCE or
                                   SCRIPTTEXT_ISPERSISTENT);


// IActiveScriptParseProcedure::ParseProcedureText() input flags

  SCRIPTPROC_HOSTMANAGESSOURCE  = $00000080;
  SCRIPTPROC_IMPLICIT_THIS      = $00000100;
  SCRIPTPROC_IMPLICIT_PARENTS   = $00000200;
  SCRIPTPROC_ALL_FLAGS          = (SCRIPTPROC_HOSTMANAGESSOURCE or
                                   SCRIPTPROC_IMPLICIT_THIS or
                                   SCRIPTPROC_IMPLICIT_PARENTS);


// IActiveScriptSite::GetItemInfo() input flags */

   SCRIPTINFO_IUNKNOWN  = $00000001;
   SCRIPTINFO_ITYPEINFO = $00000002;
   SCRIPTINFO_ALL_FLAGS = (SCRIPTINFO_IUNKNOWN or
                           SCRIPTINFO_ITYPEINFO);


// IActiveScript::Interrupt() Flags */

   SCRIPTINTERRUPT_DEBUG          = $00000001;
   SCRIPTINTERRUPT_RAISEEXCEPTION = $00000002;
   SCRIPTINTERRUPT_ALL_FLAGS      = (SCRIPTINTERRUPT_DEBUG or
    &nbs

[1] [2] [3]  下一页

打印本文 打印本文 关闭窗口 关闭窗口