   Accessing member variables in external class
  I've been writing a DirectX Window class for the past few days based on Framework that was provided to me. Right now I have a Window on screen with DirectX set up and ready to go. I just need to display something on the screen. This is where I am running into difficulties. DirectX has a Clear method as part of the "IDirect3DDevice9" class. That class is a member in my Window class. Because of the way the framework functions, the Window class is not declared and set up in the usual manner in the main cpp file, and as a result it's not that easy to get access to the Device member. IWindow* get_game_window( IGame* game ){return new D3DWindow( game );}However I still need access to the Clear method.What can I do?   
  Can you perhaps somehow declare the DirectX's class pointer as a global or pass it to the class that needs to use it? Or pass the member function pointer to Clear...I'm not fully sure how it's set up in your situation.   ;  I'm not sure I understand the situation correctly, but the first thing that comes to mind is to simply add a Clear() method to your Window class which internally calls the IDirect3DDevice9 member to do the clear operation.   ;  Thanks for the suggestions, I've sorted it now. I declared it as a global in the main cpp file and then declared it as external variable in the class's cpp file. Sure enough it's worked and I can now clear the back buffer and display a scene. Thanks.   