How to implement Active Debugging in ATL ActiveX Script Engine (216073)



The information in this article applies to:

  • Microsoft Visual C++, 32-bit Enterprise Edition 5.0
  • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
  • Microsoft Visual C++, 32-bit Professional Edition 5.0
  • Microsoft Visual C++, 32-bit Professional Edition 6.0
  • Microsoft Visual C++, 32-bit Learning Edition 6.0

This article was previously published under Q216073

SUMMARY

The 4thScrpt.exe sample demonstrates how to implement Active Debugging in an ActiveX Script Engine built with Active Template Library (ATL). The sample is designed to supplement the Active Debugging documentation available on the Microsoft Developer Network (MSDN).

This sample demonstrates how to add Active Debugging support to an ActiveX Script Engine. Active Debugging builds on Active Scripting and enables debugger host applications, such as Microsoft Script Debugger, to provide comprehensive, language-independent testing, and error correcting capabilities. Functionality, such as breakpoints, expression evaluation, and data monitoring, are all possible through the Active Debugging interfaces. Active Debugging also makes it possible to debug multiple scripts in different languages concurrently, making cross-language issues easier to locate and correct.

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
DownloadDownload the 4thScrpt.exe package now. Release Date: Jan. 20, 2000

For more information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

4thScrpt.exe185 KB
DebugExpression.cpp8 KB
DebugExpression.h3 KB
DebugSourceCodeBlock.cpp15 KB
DebugSourceCodeBlock.h6 KB
DebugStackFrame.cpp5 KB
DebugStackFrame.h2 KB
DebugToken.cpp4 KB
DebugToken.h3 KB
DForthScriptEngine.cpp26 KB
DForthScriptEngine.h6 KB
DOleScript.cpp4 KB
DOleScript.h2 KB
DScriptRuntime.cpp6 KB
DScriptRuntime.h3 KB
events.cpp9 KB
Events.h5 KB
ForthScriptEngine.cpp26 KB
ForthScriptEngine.h4 KB
OleScript.cpp45 KB
OleScript.h8 KB
OleScript.rgs1 KB
ScriptDispatch.cpp8 KB
ScriptRuntime.cpp9 KB
ScriptRuntime.h7 KB
dlldata.c1 KB
Forth.cpp5 KB
Forth.def1 KB
Readme.txt3 KB
Forth.dsp19 KB
Forth.dsw1 KB
Forth.idl9 KB
Forth.opt54 KB
Forth.plg6 KB
Forth.rc4 KB
ForthError.cpp2 KB
ForthError.h5 KB
ForthError.rgs1 KB
ForthScript.txt4 KB
Forth.mak38 KB
Forth_p.c86 KB
guids.cpp1 KB
Interpreter.cpp28 KB
Interpreter.h4 KB
Interpreter.rgs1 KB
resource.h1 KB
SourceCodeBlock.h3 KB
StackFrame.cpp2 KB
StackFrame.h3 KB
StackFrame.rgs1 KB
StdAfx.cpp1 KB
StdAfx.h4 KB
excel.4ths1 KB
forth.asp1 KB
forth.html2 KB
testForth.py3 KB
Token.cpp2 KB
Token.h2 KB
Token.rgs1 KB
ad1.lib19 KB
activdbg.h323 KB
activscp.h67 KB
ad1ex.h39 KB
dbgprop.h50 KB
MULTINFO.H8 KB
DISPEX.H31 KB

To compile the 4thScrpt.exe file

  1. In Visual C++, add a new include directory by clicking Options in the Tools menu. Select the Directories tab, and show directories for Include files. Click in the Directories window, and then add a path to the Scripting folder of this sample. Drag this path to the top of the list so that it is checked first.
  2. On the Directories tab, show directories for Library files. Click in the Directories window and add a path to the Scripting folder of this sample. Drag this path to the top of the list so that it is checked first. This folder contains headers and libraries needed to compile Active Scripting and Active Debugging projects.
  3. On the Project menu, click Settings and then click the Link tab. In the Object/Library modules, make sure that the Ad1.lib file is referenced. This file contains GUIDs necessary for Active Debugging.
  4. Build the project. You must modify the Objsafe.h file in the Visual C++ Include directory if you receive the following error messages:
    error C2065: 'INTERFACE_USES_DISPEX' : undeclared identifier
    error C2065: 'INTERFACE_USES_SECURITY_MANAGER' : undeclared identifier
    Find the definitions for the Option bits for IObjectSafety, and add definitions for INTERFACE_USES_DISPEX and INTERFACE_USES_SECURITY_MANAGER, as shown below. These bits are required by Internet Explorer.
       // Option bit definitions for IObjectSafety:
       #define	INTERFACESAFE_FOR_UNTRUSTED_CALLER	0x00000001
          // Caller of interface may be untrusted
       #define	INTERFACESAFE_FOR_UNTRUSTED_DATA	0x00000002
          // Data may be untrusted
       #define	INTERFACE_USES_DISPEX	            0x00000004
          // Object knows to use IDispatchEx
       #define	INTERFACE_USES_SECURITY_MANAGER	    0x00000008
          // Object knows to use IInternetHostSecurityManager
    						
    Once the project has compiled, the engine registers itself. See the ForthScript.txt file for more information about this sample.

REFERENCES

For more information about Active Debugging, click the following article number to view the article in the Microsoft Knowledge Base:

216271 SamScrpt.exe Demonstrates active debugging in C++ ActiveX Script Engine


Modification Type:MajorLast Reviewed:4/20/2005
Keywords:kbDebug kbhowto kbActiveXScript kbfile kbSample KB216073 kbAudDeveloper