Actually c++ works pretty well. They’ve implemented the stl templates, crt functions and win32 functions as managed code, if you don’t use safe mode then you can abuse it to your hearts content. If you want to use native dx then make sure you add a constructor and a finalizer to the class for proper cleanup, like:
~C()
{
// dispose of managed resources
managedFile->Close();
// dispose of unmanged resouses
this->!C();
}
!C()
{
// dispose of dx
d3dDevice->Release();
}
The compiler will change all that and implement a dispose interface for you.