C++ unmanaged inside winform

Posted by Gosso on Game Development See other posts from Game Development or by Gosso
Published on 2012-08-30T16:01:29Z Indexed on 2012/08/30 21:51 UTC
Read the original article Hit count: 171

Filed under:
|
|

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)
Name: DXGI_ERROR_INVALID_CALL

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();
};

© Game Development or respective owner

Related posts about c++

Related posts about c#