473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 1850
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: Dennis Owens | last post by:
I am trying to run a thread off of a form, and every once in a while the thread will raise an event for the form to read. When the form gets the event, the form will place the event into a dataset...
1
by: Mohit Sachdeva | last post by:
Hello folks. I want my app to process windows events first, so that it has some kind of a "global hook". The scenario is - i want my app to process all messages for "F3" key (or any other key for...
3
by: mra | last post by:
I want to receive a notification (via an event), whenever a property of a class is modified. Of course, this would be possible if i write code such as the following to EACH "set" part of each...
2
by: Boris Fortes | last post by:
I need to unhook event receiver as result of native C++ event. It unhooks successfully, but __raise does not return and throws access violation. Visual Studio 2003 How to reproduce: Consol...
5
by: Mong | last post by:
Hi, I have a webform with various asp controls on it such as textboxes and dropdownlists. I'm fairly new to asp.net coming from VB6 and am wondering when it's best to use client side events and...
0
by: Alexander Czernay | last post by:
I created a VB.NET-PowerPoint-AddIn as described in the VisualStudio 2003 documentation. That works very well. The AddIn adds a new toolbar to PowerPoint if the active document is based on a...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
3
by: MikeK | last post by:
Ok, I've been noodling with this for several days now and I'm starting to go crazy. Does Apple's Safari browser support drag events on Textarea elements? The few specs and docs I've found seem to...
10
by: blisspikle | last post by:
I see a lot of examples posted for Waitforsingleobject API for Processes or threads, but not events. I cannot get waitforsingleobject to subscribe to an event. I use a class PLCEthernet which is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.