axscpd2

所属分类:其他
开发工具:Delphi
文件大小:20KB
下载次数:0
上传日期:2020-04-30 16:42:54
上 传 者minhson
说明:  Shows how to host ActiveScript in a Delphi application. Includes event dispatching.

文件列表:
uScriptSite.pas (8581, 1997-08-22)
ufScriptForm.pas (5458, 1997-08-26)
ufScriptForm.dfm (2211, 1997-08-26)
AXScript.pas (17531, 1997-08-26)
uComExtra.pas (1081, 1997-06-17)
uComEvents.pas (8906, 1997-07-03)
MSScript.pas (759, 1997-05-17)
AXScriptHelp.pas (1717, 1997-07-06)
AXScriptDemo_TLB.pas (2295, 1997-06-29)
AXScriptDemo_TLB.dcr (32, 1997-06-29)
AXScriptDemo.tlb (2768, 1997-06-29)
AXScriptDemo.res (876, 1997-07-07)
AXScriptDemo.dpr (497, 1997-07-04)
uCoolObject.pas (2562, 1997-07-03)

{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\fdecor\fcharset2 Symbol;}{\f2\froman\fprq2 Times New Roman;}{\f3\froman Times New Roman;}{\f4\froman Times New Roman;}} {\colortbl\red0\green0\blue0;} \deflang1033\pard\plain\f2\fs48\b AXScriptDemo (v2)\plain\f2\fs20 \par By Brian Dupras \par Release Version 2 \par 08/26/97 \par \par \par \plain\f2\fs20\b Notes from 07/06/97: \par \plain\f2\fs20 \par This demo program was created by using a variety of sources. It originated by modifying a demo for Delphi 2.0 by David Zajac. My recent attempts to get in touch with him have been unsuccessful. I took David's demo, stripped it down to its bare parts, and converted it to Delphi 3.0. The original conversion led to the posting of AXScript.pas version 1 on the Delphi Super Page. \par \par After that, I set out to get the event calling mechanism to work, so that Delphi could call methods of the script. Ryan VanIderstine has done some work to subclass the standard TAutoObject into TAutoObjectWithEvents (TAOWE). TAOWE implements the IConnectionPoint interface to support the Advise/Sink event mechanism in COM. After playing with Ryan's code, I decided that it was suitable for the AXScript demo without modification. Thanks Ryan. \par \par Ryan has also done some work with ActiveScript. He has his own translation of the header and a demo that is more robust than this one. I kept this one simple for the sake of the sanity of he learning user. I about went out of my gourd trying to make sense of the SPRUUIDS demo on the MS VC++ CD. It's an excellent demonstration of the uses of ActivScript in C++, but it's complex as hell for a demo. Inspired by my own emotions, this demo strives to be simple, simple, simple. Just the basics. \par \par Using Ryan's demo for ActiveScript, I was able to hunt down some irritating bugs in my own demo, so thanks again Ryan. As of this writing, the only know hosting bug is allowing the script to create new objects that have been added with the SCRIPTITEM_CODEONLY flag. Executing "dim x as new TCool" in my demo with TCool being a _CODEONLY object caused all sorts of havoc. \par \par \par Also note that this demo was created using version 2 of Microsoft's JScript/VBScript binaries. Version 3 was just "released", \par but is as of yet unavailable for direct download from their web site. For more information, visit: www.microsoft.com/jscript and www.microsoft.com/vbscript. \par \par \par There is a short description of each unit at the top of each, but the main bits are described (briefly) below. \par \par AXScript is the header translation. I'm pretty sure I removed all the fluff and put it into AXScriptHelp. \par \par AXScriptHelp is just some helper code for activescript. Look at CreateScriptEngine. \par \par ufScriptForm - the main form source. A buttonClick handler in this file has the code to create, initialize, run, and clean up the scripting stuff. Look at this handler to see all the steps laid out nicely. \par \par uCoolObject defines TCoolObject. TCoolObject is the *implimentation* of ICoolObject and ICoolObjectEvents. An instance of this object is added to the script's namespace via "AddNamedItem". This is the cool part of the program, as it's the link between Delphi and the script. \par \par uScriptSite defines TScriptSite and TScriptSiteWindow. TScriptSite* is the *implimentation* of IActiveScriptSite* (defined in AXScript). A ScriptSite is needed by the engine to get information about the host. \par \par uComEvents defines the TAutoObjectWithEvents. This object, programmed by Ryan, supports the OLE event Advise/Sink mechanism. \par \par uComExtra implements the IObjectSafety interface for use with VBScript. \par \par \par \plain\f2\fs20\b Notes from 08/26/97: \par \plain\f2\fs20 \par There's been some changes to AXScript.pas to reflect IE4 updates, as well as an error with the SCRIPTTHREADID_* constants. Also, when using JScript.dll version 2.x, the program can sink events in JScript. For whatever reason, this doesn't work with JScript.dll version 3.x. \par \plain\f4\fs20 \par }

近期下载者

相关文件


收藏者