The code-run effect is shown below:
Introduced
Sometimes we don't need to provide complete scripting support, just as the ActiveX Script Host (script hosting, which may be known as the scripting engine) that this article describes, The SCRIPTCONTROLMACRO program provided in this article shows the simple implementation of scripting support with Microsoft Scripting controls, and the following techniques are included in the code:
Using a file map implementation allows only one instance of the application.
How to read binary registry data with MFC storage
How to save the recovery application window size, location
How to use a different font in a CEditView derived class
How to catch an OLE exception and display an error message
etc...
Preparations before the start
This article assumes that you are familiar with COM, ActiveX controls, OLE Automation, and how to use them in MFC. Because these technologies contain quite a bit of content, you should take a look at the content first.