Friend function can´t access Member function

Hey... I got the following parts of code:

1
2
3
4
5
6
7
8
9
10
11
MyBase-Class in MyBase.h:

int CheckError();
//Ensure ClientThread() has access to CheckError
friend unsigned int WINAPI MyClientThread(void* v);

Server-Class(inherited from MyBase) in Server.h:
friend unsigned int WINAPI MyClientThread(void *v);

MyClientThread()-Func in a .cpp:
{...CheckError()...};


But the compiler tells me the call to CheckError() in "MyCLientThread()" is an invalid call to an non-static member function...

are all friend funcs restricted to static member functions because they are not parts of the class itself?

greetz,
Inc
If CheckError isn't a static member of the class, you need a class object to call it
Topic archived. No new replies allowed.