I am modeling my whole app with one class, let's call it X. As I intend to have many X objects, I need to use a Videocapture object as a member of each X object and I need to have a member function thereof to act as a callback for GUI trackbars. Plus, my callback needs to access X.cap status. However, C++ pointers to functions as required by createTrackbar() have to be either global or static, thus defeating the idea of having many X objects. Has somebody worked around this problem? StackOverflow and other communities present non-working or non-feasible solutions. Thank you in advance!