[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2005-05-16
3
Medium Priority
?
2,300 Views
Last Modified: 2013-11-20
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 ?
0
Comment
Question by:hansw77041
3 Comments
 

Author Comment

by:hansw77041
ID: 14015787
Just found the answer
Remove  #define VC_EXTRALEAN

#define _WIN32_WINNT  0x0400
0
 
LVL 3

Expert Comment

by:NawalKishore1976
ID: 14017630
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
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 14026607
Asker resolved - The question has been PAQ'd and the 500 points have been refunded.
RomMod
Community Support Moderator
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Integration Management Part 2
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question