471,627 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Help with C# events in native C++ 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 #1
1 1790
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.

Similar topics

28 posts views Thread by Dennis Owens | last post: by
1 post views Thread by Mohit Sachdeva | last post: by
3 posts views Thread by mra | last post: by
reply views Thread by Alexander Czernay | last post: by
3 posts views Thread by MikeK | last post: by
10 posts views Thread by blisspikle | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.