As with ActiveScript, set up your application as an OLE control container by adding the following lines to your application's InitInstance() method.
BOOL CScriptApp::InitInstance() { . . . // Initialize OLE libraries, a must for ActiveScript usage. if (!AfxOleInit()) { TRACE(_T("Failed to initialize OLE libraries\n")); return FALSE; } SECAScriptOccManager *pScriptOccMgr = new SECAScriptOccManager(); AfxEnableControlContainer( pScriptOccMgr ); |
Modify your document template instantiation in your application's InitInstance() method so the ActiveHost Document and View classes are created. You may want to derive your document classes or view classes or both from SECScriptHostDoc or SECScriptHostView.
pDocTemplate = new CMultiDocTemplate( IDR_SCRPTMTYPE, RUNTIME_CLASS(SECScriptHostDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(SECScriptHostView)); |
If you want to support direct scripting access to this application (for example, through the SECAAppObj class), make the following document template entry. Use all three of the run-time classes listed below or use derived classes.
SECAFloatDocTemplate* pFloatDocTempl= new SECAFloatDocTemplate(IDR_TOPLEVEL, RUNTIME_CLASS(SECScriptHostDoc), RUNTIME_CLASS(SECADlgFrame), RUNTIME_CLASS(SECScriptHostView)); AddDocTemplate(pFloatDocTempl); |
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.