From: Simon on
Hi all

I have an MS Visual C++ MFC application. I want to allow my users to write
plug-ins to extend the app. I would like to expose a simplified version of
my internal object model, so that users can manipulate my objects in the
plug-ins. I am looking for a small-footprint, light-weight scripting
language that I can embed in my app. I'd like it to be as easy as possible
for both me and my users. A free solution would be nice.

I thought about Lua which seems to tick all the boxes except that it isn't
object-oriented. Actually I don't particularly need users to be able to
create their own classes and methods etc; but I do want them to be able to
access my internal object model, and store pointers to my objects and call
any methods on these objects which I choose to expose.

Can anyone suggest a good solution. Thanks in advance.

Simon


From: David Ching on
"Simon" <Simon2(a)newsgroup.nospam> wrote in message
news:sLednRDWhcw2OMnWnZ2dnUVZ8iCdnZ2d(a)pipex.net...
> Hi all
>
> I have an MS Visual C++ MFC application. I want to allow my users to
> write plug-ins to extend the app. I would like to expose a simplified
> version of my internal object model, so that users can manipulate my
> objects in the plug-ins. I am looking for a small-footprint, light-weight
> scripting language that I can embed in my app. I'd like it to be as easy
> as possible for both me and my users. A free solution would be nice.
>
> I thought about Lua which seems to tick all the boxes except that it isn't
> object-oriented. Actually I don't particularly need users to be able to
> create their own classes and methods etc; but I do want them to be able to
> access my internal object model, and store pointers to my objects and call
> any methods on these objects which I choose to expose.
>
> Can anyone suggest a good solution. Thanks in advance.
>

I read your first paragraph and thought "Lua". Then I read your second
paragraph. LOL! :-)

I have had great success embedding Lua into my Windows app, though it is not
MFC to reduce size even more. But Lua is somewhat object oriented and may
be enough. Check out LuaBind which is an easy way of exposing functions
(and I think classes) to script.

My first choice was actually Python. The Python language is more intuitve
than Lua, better supported, and fully object oriented (and is also free). I
believe the commercial Painshop Pro uses Python plug-ins. I last looked
about 5 years ago, and the minimum download size was about 1 MB, which was
too big for me. But maybe it's OK for you now.

-- David


From: Mihai N. on
> I have an MS Visual C++ MFC application. I want to allow my users to write
> plug-ins to extend the app. I would like to expose a simplified version of
> my internal object model, so that users can manipulate my objects in the
> plug-ins. I am looking for a small-footprint, light-weight scripting
> language that I can embed in my app. I'd like it to be as easy as possible
> for both me and my users. A free solution would be nice.

You might also consider exposing your object model as COM interfaces.
Then one will be able top automate things with almost anything
(C#, Perl, PowerShell, you name it)


--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

From: Goran on
On Jan 18, 7:17 pm, "Simon" <Sim...(a)newsgroup.nospam> wrote:
> Hi all
>
> I have an MS Visual C++ MFC application.  I want to allow my users to write
> plug-ins to extend the app.  I would like to expose a simplified version of
> my internal object model, so that users can manipulate my objects in the
> plug-ins.  I am looking for a small-footprint, light-weight scripting
> language that I can embed in my app.  I'd like it to be as easy as possible
> for both me and my users.

Standard system-supported solution to that is COM. You expose whatever
functionality you want through a set of COM interfaces.

In your app, you "embed" script control (a free download) for a simple
"scripts from within" solution, or you look at "Active Scripting" for
an all-out solution (e.g. with debugging à la MS office "development
environment").

COM gives you scripting from both within and without your executable.

From within, you have Javascript and VBScript available with no
additional work done (supported by Windows and script control). It's
possible that you can get other languages whose windows ports know COM
in (e.g. Perl of ActiveState and Python with PythonCOM).

From without, you of course still have Java/VBScript (through *.js,
*.vbs, *.wsh scripts), but also any language that knows how to
interface with COM.

IOW, scripting under Windows is a solved question ( but answer is
BIG :-) ).

Goran.
From: Rong-Chun Zhang [MSFT] on
Hello Simon,

Thank you for contacting Microsoft Support.

Beside the above suggestions, you can also try to expose a .NET Plug-in
Model, here are some detailed information
http://msdn.microsoft.com/en-us/library/11z7687s.aspx
http://msdn.microsoft.com/en-us/magazine/cc188703.aspx

The managed support service of the newsgroup microsoft.public.vc.mfc is now
available instead on Visual C++ General forum:
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/. Would you please
repost the question in the forum with the Windows Live ID used to access
your Subscription benefits? Our engineers will assist you in the new
platform. The article
http://msdn.microsoft.com/en-us/subscriptions/aa974230.aspx introduces more
information about the migration. In the future, please post your
MFC-related questions directly to the forums. If you have any questions or
concerns, please feel free to contact us: msdnmg(a)microsoft.com.

Regards,
Rongchun Zhang
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg(a)microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup and Forum support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.