Sign in to follow this  
Volverine

calling build in C# script system using managed C++

Recommended Posts

well i need to develop an script system for an application i have written in C++. now C# have a build in script system. and so far i know it can be accessed through managed C++. As my application is in C++. So can anyone kindly fill me up how can i do. any linkx to tutorial through which i can exactly know how to access that C# script system through my managed C++ code........

Share this post


Link to post
Share on other sites
Take a look in the scripting Forum area for C# - there are a few discussions on this subject (you can also search on CodeDOM which is how you can compile C# in your app, thus a intrinsic part of the discussion).

Also - check out this link:

Click

The Book is not spepcifically on this topic, however the techology you will use is exactly the same. I think the 2nd Bonus Chapter will tell you a lot.

There is also a slightly frustrating aspect to this. In VS .NET 2003 this technology was called Managed Extensions, but for 2005 its now called CLI. The language syntax to changed with the name change as well. The above link uses CLI in its examples. If you see constructs like __gc in other code examples, its using managed extensions. So beware, they are not the same. 2005 should back support but 2003 will not 'forward support'.


HTH..


#dth-0

Share this post


Link to post
Share on other sites
i am sorry that i was'nt clear on my Question,

actually i have heard that managed C++ can compile scripts generated by build in C# script system........

soo i need someone to tell me how exactly i can do that or atleast lead somewhere to learn it from, like books or articles or references........

my langauages are fixed and i cannot use any other script system, sooo please give me information regarding C# and C++ only.......

Share this post


Link to post
Share on other sites
K - let me go through this a little more with you.

First, you will need to use CLI or Managed Extensions for the purpose of providing communication between your scripting system and your engine. There are two technologies you will need to become familiar with, Embedding and Extending. CLI is probably the better option since the syntax for Managed Extensions was replaced by it, and any improvements will be made to the CLI standard. However, you need to decide what is best for you (.NET 2002/2003 doesn't seem to handle CLI for example).

The link I gave you will give you an example of how you actually do this communication across the CLI boundary. You can also look at the Reality Engine, as that's exactly the technology they use (and possibly others now that they were bought...). The idea, which is what I think you are looking to do, is to write your engine in Cpp, then expose it into C# so that you can script everything in C#. If you purely do this its just Extending (essentially you are 'extending' the .NET api to do uber-3D game graphics).

For 'embedding' You can use CodeDom to compile C#, and presumably execute it. You can also use a combination of the two as well. The thread below discusses how to compile C# into byte code and execute it:

http://www.gamedev.net/community/forums/topic.asp?topic_id=264462


Hope that helps!


#dth-0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this