Sign in to follow this  

DX + Windows Forms..

This topic is 4813 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've reached the point that I need to start making tools for my current engine. I was reading about the new Windows Forms, and decided to use them over MFC. What I'm running into however, is that Windows Forms wants you to use Managed Directx, which doesn't at all fit in with my current rendering abstraction. Can anyone help me out in understanding how to pull up unmanaged directx in windows forms using c++? Any help would be appriciated. ~Main

Share this post


Link to post
Share on other sites
What Coder means is that you can pass a "Handle" property (just a member variable) which is a hWnd from the managed part to the unmanaged part to use when creating the Device. Just pass it as a *void and cast it back. Works fine for me. Doesn't have to be of the main window itself either, it can just be one of the panels in the form too.

About using WinForms with unmanaged code in general, you have a few options. You can write the managed part in a different project and access the unmanaged part via P/Invoke or you can write you unmanaged part a managed wrapper or you can wrap your unmanaged part as a COM object. I don't know which is best; I'm trying them out myself ;)

Share this post


Link to post
Share on other sites

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