   Overloading the standard RECT?
  Is there a way to overload the standard RECT class with more useful stuff (like a obvious constructor), and to still tie it in so that I can use it for directX functions calling RECT's?I can't create one (says RECT already exists) is there any way to hide it and overwrite it? Most of the stuff just uses top, left, bottom, right, but I want to add a few things to it to make it more useful (constructors, operator overloading ect)   
  I'm assuming you're talking about the Win32 RECT structure. In which case the answer is "while possible, the behavior is not one that would be particularily well defined." As that structure was not, in any way, designed to be dealt with in such a manner. If you want to have such behavior, create your own Rect structure and give it an implicit conversion operator to RECT.   ;  class MyRect{public:  // TODO - fancy new stuff  // allow this to be given to functions that want a RECT  operator RECT&() { return mRect; }  operator const RECT&() const { return mRect; }private:  RECT mRect;};   ;  From the horse's mouth on messing with third-party structures.   ;  In this case I'd just create my own class that derives from RECT:class Rectangle : public RECT{public:  Rectangle() : RECT()  {    left = 0;    top = 0;    right = 0;    bottom = 0;  }  // etc.};This is perfectly reasonable and isn't "messing" with 3rd party structures, you're just saying that Rectangle is a specialized kind of RECT.If you look in the D3D10 and D3D11 headers, they do this themselves.   ;  Awesome, thanks! I've ran into this several times in the past, and have tried sometimes but was missing something(was doing bool operator=(const RECT, which was for assigning the value, but didnt work).   ;Quote:Original post by legalizeIn this case I'd just create my own class that derives from RECT:That was going to be my suggestion also. Am already successfully using this technique.   