No, I am trying to make a window creation class. I simply put what NeHe had as global variables in as private variables in the class, and then I put the different functions he had as public functions of the class.
Because when it is the member of a class, it is at a different scope, and has a calling convention that is different from __stdcall.
You’ll need to have that function as a non-member, or at most a friend of the class.
Okay, you left my knowledge scope. I know what a friend function is and will try that shortly but would you mind telling me what a static member function is?
Without getting too technical, a static function is one that is used for every instance of your class. (Therefore a pointer to it will be the same for every instance of your class) I’ll use a static member variable as an example because it’s a bit easier to understand. Say you have a static int m_num in a class Blah; If you were do to this…
Blah a, b;
a.m_num = 10;
if (b.m_num == 10)
{
// this’ll be true…
b.m_num = 5;
// now a.m_num == 5
}
You can only access other static members from within a static function. With functions it more to do with the pointer functions in the vtable. If you don’t know what a vtable is, don’t worry about it. Just realize that static functions can only access static members. (But non-static functions CAN access static members.)
Another quirk of static functions is that you can call them w/o instantiating a class… say you had a static SomeFunc() in class Blah. You could call it like so…