Menu

TryEnterCriticalSection and Windows

Help
Noel Byron
2000-06-19
2000-06-21
  • Noel Byron

    Noel Byron - 2000-06-19

    Hi,

    the function TryEnterCriticalSection() (used in thread.h) applies only to
    WinNT and newer. It would be a pity if programs using this library could
    not work on Win 95 or Win 98. In my opinion at least :-)

    I also encounter the folowing problem:
    I am running Win NT with VC++ 5.0. When I try to compile thread.h
    I receive the message that the symbol TryEnterCriticalSection() could
    not be resolved. Looking in winbase.h I find the following code:
    #if(_WIN32_WINNT >= 0x0400)
    WINBASEAPI
    BOOL
    WINAPI
    TryEnterCriticalSection(
        LPCRITICAL_SECTION lpCriticalSection
        );
    #endif /* _WIN32_WINNT >= 0x0400 */

    So I tried to find out, what value of _WIN32_WINNT is and
    what a funny surprise: It is not defined at all.
    BTW: I am sure that I run WinNT!  :-]

    Does anybody know about this M$ feature or must I define
    _WIN32_WINNT on my own?

    Many thanks in advance,
    Byron

     
    • David Sugar

      David Sugar - 2000-06-21

      There has been a proposed new mutex class that is being tested which should
      address this issue of "portability" between win95/98 and winnt...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.