Help with C# events in native C++ COM

G

Guest

I’m developing script system based on C# script for a game engine.
Scripts are written in C# and compiled at run time by a C# class library.
The native C++ game code accesses the script compiler class library through
a COM interface. Compile scripts are passed back to the native C++ game code
as COM interfaces as well. To run a script the game calls
pScript->Run(pGameInterface). The pGameInterface is another COM object
written in C# that is used to pass context data to the scripts.

What I would really like to do is allow the scripts to call a method on the
game interface object and have that object either fire an event handled by
the C++ game code or call a function in the C++ game code (maybe using
connection points).

Pseudo code:
pGameInterface.CreateInstance(CLSID)
pGameInterface.SetCallback(&CallBackHandler)
pScript->Run(pGameInterface)

Two important requirements are that the C++ code not use ATL or managed C++.
Anyone have suggestions on what would be the best and simplest solution.
 
C

Colin Neller

If you don't get a response to you question in this group, I would suggest
posting it in the "microsoft.public.dotnet.framework.interop" group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top