Is it possible to write a C++ plugin that can access the the scripting API?
Check out Pro and the User manual on Plugins.