I want to redefine a struct that is already declared by the win32 api. I just want to add a few operator overloads and stuff to it, but I am not sure how to do this.
Printable View
I want to redefine a struct that is already declared by the win32 api. I just want to add a few operator overloads and stuff to it, but I am not sure how to do this.
Make a class, that has a different name, that has the win32 struct as a private data member. And then write whatever interface you really want.
Not sure what you have in mind though...usually I find myself wrapping the Win32 functions into a class, so that I don't have to look at their 15 parameters all the time...
alright that sounds like a good idea, what I have right now is I am just stoping it from declaring it's own struct and I am repliating it. It is working ok but I can see flaws in my way. Thanks.
you can declare your class within a namespace and derive it directly from the WINAPI struct:
Code:namespace my {
struct WNDCLASSEX : public ::WNDCLASSEX
{
};
}
int
main(void)
{
my::WNDCLASSEX wce;
}