roadragedave
April 29th, 2004, 07:52 AM
All I want to do is have a while loop repeating untill a key-stroke is hit, I got this code off the MSDN
(BeginThread Example) (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__beginthread.2c_._beginthreadex.asp) and it works when I build a project on its own.
I tried to add some of the code to my own proj like so:
void CheckKey( void *dummy );
BOOL repeat = TRUE;
void main(void)
{
......
......
_beginthread(CheckKey, 0, NULL);
while(repeat)
{
......
......
}
}
//seperate thread that waits for a key-stroke
void CheckKey( void *dummy )
{
_getch();
repeat = 0; /* _endthread implied */
}
but then I get this error:
error C3861: '_beginthread': identifier not found, even with argument-dependent lookup
I have included process.h, am I missing a lib file or something????:confused:
(BeginThread Example) (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__beginthread.2c_._beginthreadex.asp) and it works when I build a project on its own.
I tried to add some of the code to my own proj like so:
void CheckKey( void *dummy );
BOOL repeat = TRUE;
void main(void)
{
......
......
_beginthread(CheckKey, 0, NULL);
while(repeat)
{
......
......
}
}
//seperate thread that waits for a key-stroke
void CheckKey( void *dummy )
{
_getch();
repeat = 0; /* _endthread implied */
}
but then I get this error:
error C3861: '_beginthread': identifier not found, even with argument-dependent lookup
I have included process.h, am I missing a lib file or something????:confused: