Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Choose between C runtime library and Win32 API

Choose between C runtime library and Win32 API

Scheduled Pinned Locked Moved C / C++ / MFC
jsontutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NicholasCougar
    wrote on last edited by
    #1

    Hi, It's not easy to choose between functions in C runtime library and Win32 API, for example, CreateThread() and EndTread() are in Win32 API, _beginthreadex() and _endthreadex() in C runtime library. Can anybody tell me the difference and reason why I should choose one of then instead of the other. Thank you in advance. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.

    C 1 Reply Last reply
    0
    • N NicholasCougar

      Hi, It's not easy to choose between functions in C runtime library and Win32 API, for example, CreateThread() and EndTread() are in Win32 API, _beginthreadex() and _endthreadex() in C runtime library. Can anybody tell me the difference and reason why I should choose one of then instead of the other. Thank you in advance. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      In this case, I believe you should choose the C runtime, because I seem to recall Richter had bad things to say about CreateThread and EndThread. As a rule, I prefer C++ over C functions, and standard functions over M$ specific ones, but overall for something OS dependant like threading I would go with the M$ ones, except in this case where Jeff Richter says not to. There, was that confusing enough for you ? :-) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?! - Jon Hulatt, 22/3/2002

      N 1 Reply Last reply
      0
      • C Christian Graus

        In this case, I believe you should choose the C runtime, because I seem to recall Richter had bad things to say about CreateThread and EndThread. As a rule, I prefer C++ over C functions, and standard functions over M$ specific ones, but overall for something OS dependant like threading I would go with the M$ ones, except in this case where Jeff Richter says not to. There, was that confusing enough for you ? :-) Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?! - Jon Hulatt, 22/3/2002

        N Offline
        N Offline
        Nish Nishant
        wrote on last edited by
        #3

        Hi CG, Richter's advice was that we should use _beginthreadex if we plan on using CRT functions inside our thread. But if we are not, then we might as well use the API calls to start threads Nish

        _


        If I am awake and my eyes are closed, it does not necessarily mean that I am thinking of naked women._

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups