🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Evaluating AngelScript ... can AS use COM?

Started by
2 comments, last by rvoith 10 years, 4 months ago

In previous projects I have used VBScript as scripting language, but are now searching for alternatives. AngelScript seems very powerful. One of the extreme powers in VBScript is the abilities to use COM, which makes it easy to let the scripts access other systems, like databases etc. Is that possible in a similiar fasion with AngelScript?

Advertisement

In short, no.

I think the only way for AngelScript to be able to use COM would be for your application to have a series of wrapper classes around COM objects. I have toyed with adding some sort of #import directive to my application's preprocessor to dynamically build COM wrapper classes. If I can get all of that worked out then, one day, there could be a COM add on for AngelScript.

I should also add that the application to which I contribute recently made the switch from Microsoft's VBScript/JScript engine to AngelScript, and we are very pleased. The integration of our applications objects with the scripting language is much, much easier and maintainable. We had some scripts which used COM objects, primarily Excel, but we are writing wrappers specifically for Excel automation. I think this will be adequate until we write a more general COM solution.

AngelScript doesn't come with any pre-integration for COM objects, but there is no reason why you shouldn't be able to use COM objects in AngelScript.

The fact that COM objects are reference counted and rely on factory functions for instantiation is a perfect match with AngelScript, so the memory management should be easy enough. You'll likely need to use wrappers in some cases where the primitives defined by COM doesn't match what AngelScript has, but otherwise it should be as easy to use COM as any other C++ classes.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thanks Jason and Andreas for your answers! I will do a test-round with AngelScript. The more I read, the more I like it!

This topic is closed to new replies.

Advertisement