Coffeehouse Post

Single Post Permalink

View Thread: C++ needs extension methods
  • User profile image

    doing some C++ work ... c++ would be better with extension methods.

    Working with a C++ class library. One class has a function that returns the position and size of a window.
    void  GetWindowRect(long *XPos, long *YPos, long *Width, long *Height) const; 

    But I need the window info as a RECT. In C# that is no problem. Just code an extension method. No can do in C++.  Even the simple process of organizing your code is a bit of a chore in C++ compared to C#.  As I code the helper functions which will work like extension methods, where to place the code? I do not think I can add sub folders to a c++ project like I can in C#.