By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,864 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,864 IT Pros & Developers. It's quick & easy.

Help with C# events in native C++ COM

P: n/a
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.

Jan 5 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

--
Colin Neller
http://www.colinneller.com/blog
"Scythen" <Sc*****@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
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.

Jan 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.