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

Posted on 2005-05-16
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 ?
Question by:hansw77041

    Author Comment

    Just found the answer
    Remove  #define VC_EXTRALEAN

    #define _WIN32_WINNT  0x0400
    LVL 3

    Expert Comment

    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 for 95/98 options

    Accepted Solution

    Asker resolved - The question has been PAQ'd and the 500 points have been refunded.
    Community Support Moderator

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    sum13 challenge 24 69
    has22 challenge 11 56
    matchUp  challenge 6 37
    wordcount challenge 11 49
    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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
    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.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now