error C2065: 'AfxBeginThread' : undeclared identifier

Posted by bdhar on Stack Overflow See other posts from Stack Overflow or by bdhar
Published on 2010-02-26T14:05:13Z Indexed on 2010/03/11 19:49 UTC
Read the original article Hit count: 199

Filed under:
|
|

I have a simple ATL Service in which I have included the following statement.

AfxBeginThread(WorkerThread, this, THREAD_PRIORITY_NORMAL, 0, 0);

But the compiler complains that

error C2065: 'AfxBeginThread' : undeclared identifier

But in MSDN i found that AfxBeginThread is found in AFXWIN.H

If I include AFXWIN.H, the compiler complains that

fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>

What am I missing here? Thanks.

PS: I am using Visual Studio 6.0 Enterprise Edition in Windows XP SP2.

© Stack Overflow or respective owner

Related posts about vc++

Related posts about atl