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. CWinthread

CWinthread

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
7 Posts 2 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.
  • L Offline
    L Offline
    LCI
    wrote on last edited by
    #1

    I would really like to use CWinThread class. I have an odd situation where i am in a dll and would like to use a thread. For come reason CWinThread is not accessible here. When i try to inclde afxwin.h before my stdafx.h I would not compile on : CWinThread *pThread; I get the following errors error C2143: syntax error: missing ';' before'*' error C2501: 'CWinThread':missing storage-class or type specifiers. Any idea what is going on here?

    L M 2 Replies Last reply
    0
    • L LCI

      I would really like to use CWinThread class. I have an odd situation where i am in a dll and would like to use a thread. For come reason CWinThread is not accessible here. When i try to inclde afxwin.h before my stdafx.h I would not compile on : CWinThread *pThread; I get the following errors error C2143: syntax error: missing ';' before'*' error C2501: 'CWinThread':missing storage-class or type specifiers. Any idea what is going on here?

      L Offline
      L Offline
      LCI
      wrote on last edited by
      #2

      Maybe there is something in my 'properties' that i am missing ?? :-)

      1 Reply Last reply
      0
      • L LCI

        I would really like to use CWinThread class. I have an odd situation where i am in a dll and would like to use a thread. For come reason CWinThread is not accessible here. When i try to inclde afxwin.h before my stdafx.h I would not compile on : CWinThread *pThread; I get the following errors error C2143: syntax error: missing ';' before'*' error C2501: 'CWinThread':missing storage-class or type specifiers. Any idea what is going on here?

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        Why not include afxwin.h IN stdafx.h? Build a quick temporary MFC project with the project wizard and you'll see a working arrangement for the MFC header files. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        L 1 Reply Last reply
        0
        • M Mark Salsbery

          Why not include afxwin.h IN stdafx.h? Build a quick temporary MFC project with the project wizard and you'll see a working arrangement for the MFC header files. Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          L Offline
          L Offline
          LCI
          wrote on last edited by
          #4

          Have the same problem if i include afxwin.h IN stdafx.h Could it be that my .dll is a win32 and cannot run MFC classes?

          L M 2 Replies Last reply
          0
          • L LCI

            Have the same problem if i include afxwin.h IN stdafx.h Could it be that my .dll is a win32 and cannot run MFC classes?

            L Offline
            L Offline
            LCI
            wrote on last edited by
            #5

            How would i get around this using a Win32 dll trying to implement an MFC class like CwinThread? If this is not possible, what are my thread options. I am simply creating a waitable timer but wanted to do this in a thread. thanks,

            M 1 Reply Last reply
            0
            • L LCI

              How would i get around this using a Win32 dll trying to implement an MFC class like CwinThread? If this is not possible, what are my thread options. I am simply creating a waitable timer but wanted to do this in a thread. thanks,

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              If all you are using is CWinThread from MFC, then you really don't need the entire MFC library.  Just use what's appropriate for a given module: Module uses           Use this to create a thread ------------          ------------------------------- MFC:                     CWinThread CRT (no mMFC):      _beginthread()/_beginthreadex() No CRT or MFC:       CreateThread() Windows API     Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              1 Reply Last reply
              0
              • L LCI

                Have the same problem if i include afxwin.h IN stdafx.h Could it be that my .dll is a win32 and cannot run MFC classes?

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                An MFC DLL is a Win32 DLL.  Getting it to compile has nothing to do with the type of DLL. The MFC header file(s) and/or Windows SDK header files need to be included in a certain order. Again, if you need to know for sure how to order the includes correctly, create a temporary MFC project with the wizard and copy the way stdafx.h is layed out.  It's better than trying to guess. Mark

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                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