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. ATL / WTL / STL
  4. AfxBeginThread may use in activex control(ATL)?

AfxBeginThread may use in activex control(ATL)?

Scheduled Pinned Locked Moved ATL / WTL / STL
c++comtutorialquestion
4 Posts 4 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.
  • A Offline
    A Offline
    alan top
    wrote on last edited by
    #1

    if not, how to use thread in the activex ? alantop

    S 1 Reply Last reply
    0
    • A alan top

      if not, how to use thread in the activex ? alantop

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      AfxBeginThread is an MFC function. If you're using MFC then you can use this; if not use beginthread or beginthreadex (CRT) or CreateThread (Win32). Unless you know what you're doing prefer the CRT functions. Steve

      J 1 Reply Last reply
      0
      • S Stephen Hewitt

        AfxBeginThread is an MFC function. If you're using MFC then you can use this; if not use beginthread or beginthreadex (CRT) or CreateThread (Win32). Unless you know what you're doing prefer the CRT functions. Steve

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        The CRT functions are required if you're going use the CRT library (these functions initializes the CRT for each new thread). A fact which I was not aware until recently. :sigh:

        -- 100% natural. No superstitious additives.

        L 1 Reply Last reply
        0
        • J Jorgen Sigvardsson

          The CRT functions are required if you're going use the CRT library (these functions initializes the CRT for each new thread). A fact which I was not aware until recently. :sigh:

          -- 100% natural. No superstitious additives.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Me too! I discovered that only this week and I now use _beginthreadex exclusively. If you use CRT (especially date/time) functions in a thread, then without _beginthread[ex] you will leak memory - OK, not a lot, but a leak is still a leak.

          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