Hi all,
Following is my program,
My header file,
my CPP file
I am using borland C++ builder 6 and my OS is WinXP. When I build this project I get the error, "Use . or -> to call Test::AnotherFu nc()". I am not able to understand why this is happening ?
If I try to declare iGlobal in my Test class, I get the error message "member Test::iGlobal cannot be used without an object".
Can somebody help me with these two errors and explain these errors....
Following is my program,
My header file,
Code:
class Test
{
private:
........ some declarations......
public:
Test();
~Test();
int AnotherFunc();
//my thread function
static DWORD WINAPI threadFunc(LPVOID);
}
Code:
int iGlobal = 0;
Test::Test()
{
......some processes and declarations....
HANDLE hThrd = CreatThread(NULL, 0, threadFunc, NULL, 0, NULL);
.........some other processes.......
CloseHandle(hThrd);
}
int Test::AnotherFunc()
{
........
return 0;
}
DWORD WINAPI Test::threadFunc(LPVOID lpArgs)
{
iGlobal = 0;
.....it does some processs......
if(iGlobal == 1)
AnotherFunc();
return 0;
}
If I try to declare iGlobal in my Test class, I get the error message "member Test::iGlobal cannot be used without an object".
Can somebody help me with these two errors and explain these errors....
Comment