0
votes

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.

1
What else are you including? If windows.h remove thatmmmmmm
I m just trying to add AFXWIN.H. But the compiler says that above error C1189.. not sure why!! If i remove it, the other error appears.. C2065bdhar
We need to see what you have includedmmmmmm
you should use AfxBeginThread on MFC projects.Nick Dandoulakis
@Nick D.. But ATL service is an MFC, project right? And I am using AfxBeginThread..bdhar

1 Answers

0
votes

An ATL project is NOT a MFC project using ATL. Use _beginthreadex().