Sign in to follow this  

[.net] Embedding C++ engine to C# level editor

This topic is 4688 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to embed an "in-engine" test feature in my C# level editor. I want the game's engine (written in C++) to start running the level in a .NET window, so I create a new process that executes the game and pass the level file and the HANDLE to the window I want to render to as parameters. The problem is, the game's engine will receive no kind of input messages (e.g. keystrokes, mouse) from that window. Can someone who knows the workings of .NET forms offer any assistance as to why that happens? Is there a way to pass the window messages to the process running the game, so that I can actually play my level in the .NET window? Thanks for any replies.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think you could overide the WndProc method in your form. Then you can process the necessary messages and pass them to your game. Another alternative would be to do away with those messages in your engine and just use directinput.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Then you can process the necessary messages and pass them to your game.


The problem is: how do I do that? If I use the Win32 SendMessage function using P/Invoke to send the message to the game engine's process HWND (processs.MainWindowHandle property), I end up re-processing the same message in my .NET application because that HWND is the same handle to my .NET window.

(I don't know if directinput would work around this problem, and I don't care actually. I want to gain an understanding on this particular problem more than I want to make it work).

Share this post


Link to post
Share on other sites

This topic is 4688 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this