Click here to Skip to main content
13,772,265 members
Click here to Skip to main content
Add your own
alternative version


126 bookmarked
Posted 15 Jul 2003

Embeddable script editor for MFC applications

, 15 Jul 2003
Rate this:
Please Sign up or sign in to vote.
A library that allows you to embed scripting functionality to your C++ MFC application.

Objects Events Listing

Sample screenshot

Pop-Up Object properties and methods list

Sample screenshot

IntelliSense - like function parameters tooltips


I've been searching the net for a suitable and affordable solution that will allow me to embed scripting functionality in my C++ application. What I found was either not sufficient or cost a lot of money.

So I've decided to make one of my own. After about a month of work and testing I've come up with this embeddable scripter.

I made it a separate DLL , which is really easy to use.


  1. Download the source code, and compile it. Make sure to compile the correct version (Debug\Release) or both.
  2. Include ScriptEditor.h in your project and add the library ScriptEditor.lib to your additional libraries. Make sure to reference the correct version! Debug version for debugging and release version for release!
  3. Copy the DLL to the same folder as your executable.
  4. In your code create an instance of CScripter and initialize it.
  5. Add your objects to the script and optionally the script text.


In the header of your main application window add:

#include "..\ScriptEditor\Scripter.h"

Add member variable:

CScripter scripter;

Then when initializing add:


After that add your objects to the script:

scripter.AddObject("MPlayer",(IDispatch *)m_mediaPlayer.GetControlUnknown());
      (IDispatch *)m_commandButton.GetControlUnknown());
scripter.AddObject("TabStrip",(IDispatch *)m_tabStrip.GetControlUnknown());

And optionally set the script text:

scripter.scriptText = "MsgBox \"Test message\"";

After that the script is ready to run, you now may do one of the following:

// Run the script

// Stop the script execution


// Open the script editor window


// Reset the script (All added objects are removed and engine is recreated)



This is the first release so it's probably not bug free. I've done my best to track any bugs but there are always surprises. So I will post here any additions, patches and fixes that will follow.

  • 19/07/03 - The DLL source was updated to compile in VS.NET (read the messages below)


  • Gil Eizenburg for debugging and testing.
  • Smaller Animals Software, Inc. for ColorEditWnd class.
  • Daniel Madden for CTokenEx class.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Alex Hazanov
Software Developer (Senior) RDV Systems
Israel Israel
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralRe: I get "Permission Denied" error (solution found) Pin
Alex Hazanov24-Dec-03 11:59
memberAlex Hazanov24-Dec-03 11:59 
GeneralRe: I get "Permission Denied" error (solution found) Pin
Jason Troitsky24-Dec-03 15:09
memberJason Troitsky24-Dec-03 15:09 
GeneralRe: I get "Permission Denied" error (could this be the solution?) Pin
Jason Troitsky7-Jan-04 10:29
memberJason Troitsky7-Jan-04 10:29 
GeneralReference Counting Problem Pin
Danver Hartop5-Dec-03 11:39
memberDanver Hartop5-Dec-03 11:39 
GeneralRe: Reference Counting Problem Pin
Alex Hazanov6-Dec-03 22:53
memberAlex Hazanov6-Dec-03 22:53 
GeneralRe: Reference Counting Problem Pin
Danver Hartop8-Dec-03 9:34
memberDanver Hartop8-Dec-03 9:34 
GeneralRe: Reference Counting Problem Pin
Alex Hazanov9-Dec-03 10:36
memberAlex Hazanov9-Dec-03 10:36 
QuestionHow can I add my own objects ? Pin
Tony D.27-Nov-03 10:22
memberTony D.27-Nov-03 10:22 
GeneralFeatures request 2 Pin
M.Khadem13-Nov-03 17:22
memberM.Khadem13-Nov-03 17:22 
GeneralRe: Features request 2 Pin
Anonymous16-Nov-03 21:21
memberAnonymous16-Nov-03 21:21 
GeneralRe: Features request 2 Pin
Alex Hazanov16-Nov-03 21:24
memberAlex Hazanov16-Nov-03 21:24 
GeneralRe: Features request 2 Pin
M.Khadem19-Nov-03 1:25
memberM.Khadem19-Nov-03 1:25 
GeneralRe: Features request 2 Pin
Alex Hazanov22-Nov-03 1:46
memberAlex Hazanov22-Nov-03 1:46 
GeneralAdding TypeLib Support Pin
Danver Hartop25-Oct-03 21:47
memberDanver Hartop25-Oct-03 21:47 
GeneralRe: Adding TypeLib Support Pin
Alex Hazanov16-Nov-03 21:31
memberAlex Hazanov16-Nov-03 21:31 
GeneralIncremental re-parseing is needed. Pin
Ed Deighton25-Oct-03 7:05
memberEd Deighton25-Oct-03 7:05 
GeneralRe: Incremental re-parseing is needed. Pin
Ed Deighton26-Oct-03 16:39
memberEd Deighton26-Oct-03 16:39 
QuestionOnly English?? Pin
mutter2124-Oct-03 17:51
membermutter2124-Oct-03 17:51 
AnswerRe: Only English?? Pin
Alex Hazanov25-Oct-03 14:20
memberAlex Hazanov25-Oct-03 14:20 
GeneralRe: Only English?? Pin
mutter2126-Oct-03 4:46
membermutter2126-Oct-03 4:46 
GeneralActiveX Scripting in MFC Pin
TW19-Sep-03 2:49
memberTW19-Sep-03 2:49 
GeneralRe: ActiveX Scripting in MFC Pin
Alex Hazanov20-Sep-03 21:39
memberAlex Hazanov20-Sep-03 21:39 
QuestionHow about support other language (JScript)? Pin
davido25-Sep-03 3:05
memberdavido25-Sep-03 3:05 
AnswerRe: How about support other language (JScript)? Pin
Anonymous6-Sep-03 9:49
memberAnonymous6-Sep-03 9:49 
GeneralSome bugs (2) Pin
Brian van der Beek20-Aug-03 23:36
memberBrian van der Beek20-Aug-03 23:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.181119.1 | Last Updated 16 Jul 2003
Article Copyright 2003 by Alex Hazanov
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid