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