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. MFC Thread problem

MFC Thread problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
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.
  • O Offline
    O Offline
    Ola Carlsson
    wrote on last edited by
    #1

    Hi all, I’m trying to make use of some threads in my programs. Then I try to build my project(MFC), this error turn up. “fatal error LNK1561: entry point must be defined” My code is similar: UINT CTestDlg::threadProc(LPVOID p) { CTestDlg * me = (CTestDlg *)p; me->classProc("ThreadTest"); return 0; } void CTestDlg::classProc(const CString mesage) { AfxMessageBox(message); } void CTestDlg::OnOkButton() { HWND hWnd = GetSafeHwnd(); AfxBeginThread( threadProc, hWnd, THREAD_PRIORITY_NORMAL ); } Can you help me what to do? Thanks, Ola Carlsson olaca428@student.liu.se

    T N 2 Replies Last reply
    0
    • O Ola Carlsson

      Hi all, I’m trying to make use of some threads in my programs. Then I try to build my project(MFC), this error turn up. “fatal error LNK1561: entry point must be defined” My code is similar: UINT CTestDlg::threadProc(LPVOID p) { CTestDlg * me = (CTestDlg *)p; me->classProc("ThreadTest"); return 0; } void CTestDlg::classProc(const CString mesage) { AfxMessageBox(message); } void CTestDlg::OnOkButton() { HWND hWnd = GetSafeHwnd(); AfxBeginThread( threadProc, hWnd, THREAD_PRIORITY_NORMAL ); } Can you help me what to do? Thanks, Ola Carlsson olaca428@student.liu.se

      T Offline
      T Offline
      Tim Smith
      wrote on last edited by
      #2

      You don't have a main for some reason. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

      1 Reply Last reply
      0
      • O Ola Carlsson

        Hi all, I’m trying to make use of some threads in my programs. Then I try to build my project(MFC), this error turn up. “fatal error LNK1561: entry point must be defined” My code is similar: UINT CTestDlg::threadProc(LPVOID p) { CTestDlg * me = (CTestDlg *)p; me->classProc("ThreadTest"); return 0; } void CTestDlg::classProc(const CString mesage) { AfxMessageBox(message); } void CTestDlg::OnOkButton() { HWND hWnd = GetSafeHwnd(); AfxBeginThread( threadProc, hWnd, THREAD_PRIORITY_NORMAL ); } Can you help me what to do? Thanks, Ola Carlsson olaca428@student.liu.se

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

        First of all your thread proc cannot be a non-static member function of a class. Either make it static or use a global function as thread proc. Nish

        My miniputt high is now 29 I do not think I can improve on that My temperament won't hold www.busterboy.org

        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