Original Post
I am trying to write a Managed C++ class that has an unmanaged Direct3D Device as a member. Ultimately a C# class would make calls to the Managed C++ class to access the unmanaged Direct3D device to ultimately wrap it in an C# managed Direct3D Device. Unfortunately this is not working and I get the following error. error C3635: '::IDirect3DDevice9': undefined native type used in 'ManagedBridge::MDirect3D; imported native types must be defined in the importing source code Apparently I cannot write a managed C++ class that has a native Direct3D Device as a member. Here is a simple code snippet I wrote #ifndef MDIRECT3D #define MDIRECT3D #include #include #include #using using namespace System; static LPDIRECT3DDEVICE9 deviceHandle = NULL; namespace ManagedBridge { public __gc class MDirect3D { public: inline static void SetDirect3DDevice(void * device) { deviceHandle = (LPDIRECT3DDEVICE9)device; } inline static LPDIRECT3DDEVICE9 GetDirect3DDevice() { return deviceHandle; } }; } #endif I'm simply trying to write an mc++ class that provides access to an unmanaged Direct3D device from C#. Is there another way I can do something similar to the code I wrote above? Thanks,