Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First: I am using C# and C++ on windows 7.

I have created a basic rendering engine in c++ with directx 10. It works good as a stand alone application. But, when I sending the Form.Handle of a WinForm I want to render inside to the engine it crashes during D3D10CreateDeviceAndSwapChain with the following error:

HRESULT: 0x887a0001 (2289696769)

I get the handle from the winform during loading of the form.

unsafe {
  void *ptr=m_view.Handle.ToPointer();
  uint v = (uint)ptr;
  lhandle = v.ToString();
share|improve this question
For better support, also try stackoverflow, this is a good candidate question for that site. – teodron Aug 30 '12 at 16:03
Can you show your actual D3D10CreateDeviceAndSwapChain/CreateDevice call? – CiscoIPPhone Aug 30 '12 at 16:43
This is the code that I call in Render::Init(...) : – Gosso Aug 30 '12 at 16:50
So it's an entirely different process - that could be causing the issue. Perhaps it would work if the C++ app was a dll called from the C# app? I'll see if I can find any more info about this. – CiscoIPPhone Aug 30 '12 at 19:19
Make your c++ engine a dll or make a CLR wrapper for it, then it will work. – Barış Uşaklı Aug 30 '12 at 19:33
up vote 1 down vote accepted

One has to create a CHILD to the parent window, not use the parent window handle directly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.