Link to home
Start Free TrialLog in
Avatar of hansw77041
hansw77041

asked on

error C2039: 'TryEnterCriticalSection' : is not a member of '`global namespace''

In one project I used  ::TryEnterCriticalSection(&g_DataAccess) and it works just fine, on the next very similar project ther compiler issues this error.

error C2039: 'TryEnterCriticalSection' : is not a member of '`global namespace''

In VC6 when I type ::TryEnterCriticalSection the IDE pops up the help box and it allows me to select TryEnterCriticalSection...

So the IDE know about the function but the compiler does not.

What do I need to do to get rid of this error ?
Avatar of hansw77041
hansw77041

ASKER

Just found the answer
Remove  #define VC_EXTRALEAN

#define _WIN32_WINNT  0x0400
Change the Project Setting to  Nomal Debug or release
It will work only for NT and above and does not work on 98, 95.

Check
http://www.codeproject.com/threads/9xtryentercs.asp for 95/98 options
ASKER CERTIFIED SOLUTION
Avatar of RomMod
RomMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial