Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Jason Z

Windows forms and my Unmanaged engine

This topic is 5281 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

I recently started investigating using Forms to build tools with my unmanaged c++ / dx engine. I have read alot of information stating that the .net framework is capable of mixing managed and unmanaged code together. So my question is, what configuration do I need in order to start working on my tools? Should I use a managed c++ forms application or is there some way to use the forms from an unmanaged application? I would greatly appreciate if anyone has had similar difficulties and has found references or tutorials if they could post them. Thanks, Jason Z

Share this post

Link to post
Share on other sites
Windows Forms is part of the .NET framework and thus you need to work in managed code to access them.

However, Windows Forms provides hooks that unmanaged code can use. For example, anything derived from the Control class (including the Form class) exposes a Handle property, which will retrieve an HWND for that control. This can be passed to unmanaged code and utilized by your engine for rendering to a window.

It also depends on just how much of the original Win32 API your engine needs. HWND is definitely one, and HINSTANCE might be another. The latter is a little more difficult, as you have a dive a little deeper into how .NET handles assemblies, modules, app domains, etc., but is really just a few function calls.

Lastly, MFC is a good platform for rapid tool development. And it will integrate with your engine more nicely since it''s built directly around Win32.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!