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
S

susanne1

@susanne1
About
Posts
128
Topics
45
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Thread paused
    S susanne1

    void CMyThread::ThreadStart() { if (m_pSelThread != NULL) // CWinThread* m_pSelThread; { if (::WaitForSingleObject(m_pSelThread->m_hThread, 0) != WAIT_OBJECT_0) return; delete m_pSelThread; m_pSelThread = NULL; } m_pSelThread = AfxBeginThread((AFX_THREADPROC)ThreadFunction, this, THREAD_PRIORITY_NORMAL, 0,CREATE_SUSPENDED); m_pSelThread->m_bAutoDelete = FALSE; m_pSelThread->ResumeThread(); } UINT CMyThread::ThreadFunction ( LPVOID param ) { while(!bTerminate) // bool bTerminate { if ((::WaitForSingleObject(m_Sel_End_Event, 0) == WAIT_OBJECT_0)) { bTerminate = true; continue; } }

    C / C++ / MFC c++

  • Thread paused
    S susanne1

    i changed the thread priority to HIGHEST, but it didi not help.

    C / C++ / MFC c++

  • Thread paused
    S susanne1

    I have a thread, it is has a normal priority, when it starts to excute, it runs for 5 or 6 seconds then stops for 3 or 4 seconds and run again, stops again this goes till it finishes his work. Any idea why this happens, programm code is in Visual C++. Thanks

    C / C++ / MFC c++

  • Blinking cursor
    S susanne1

    The reason that in the Output view will be alot of output lines over 40000 lines and the a view derived from CEditView or CRichEditView will not give it on the screen like it should without using a very complicated code, so i am must use a view derived from CView. I used CreateCaret and ShowCaret() but they did not solve the problem.

    C / C++ / MFC help tutorial

  • Blinking cursor
    S susanne1

    Sorry for not replaying was sick. I can not use CEditView, CRichEditView, because this is the requirments of my Boss, i would like too but it will make complicates somewhere else.

    C / C++ / MFC help tutorial

  • Blinking cursor
    S susanne1

    Hallo, i have SDI Application i need to get a blinking cursor when i click the Left mouse button(i have the fucntion OnLButtonUp(UINT nFlags,CPoint point) already, also i have the position where the mouse click happend, my View class is derived from CView Class. but i do not know how to darw the cursor that blinks),Please help.

    C / C++ / MFC help tutorial

  • SDI Application
    S susanne1

    i need to print out the results of a database query, a class derived directly from CView is the only suitable possible solution till now i had before classes derived from CRichEditView and CEditView buut i hhad a lot of disadvanteges and ristrictions with them.

    C / C++ / MFC

  • SDI Application
    S susanne1

    The problem is i do not have a blinking cursor., because this is a view derived from CView calss.

    C / C++ / MFC

  • SDI Application
    S susanne1

    Hallo, i have an SDI-Application it is View class derived directly from CView, i need tob e able to change the output in it or to move the cursor with ctrl+pos1 or ctrl+end .Important: I can not use the class CRichEditView instead of CView to drive the View of my application. Thanks.

    C / C++ / MFC

  • How to terminate the secondary thread when the application closed?
    S susanne1

    thanks. I am using SDI application, so i will put the code in BOOL OnNewDocument() instead of OnInitDialg(). Now a general question: why can i not use ON_WM_CLOSE() to tell the small thread to terminate himself and if yes how? Thanks a lot

    C / C++ / MFC c++ help tutorial question

  • How to terminate the secondary thread when the application closed?
    S susanne1

    bool PrintMy Results(const CString& strMyResult) { bool bTerminate = false; while(!bTerminate && nCount < arrMyResults.GetSize()) { if (::WaitForSingleObject(m_End_Event.m_hObject, 0) == WAIT_OBJECT_0) { bTerminate = true; continue; } nCount++; // Code to print the Array-Elements // I am hier inside the secondary thread wich is in another // class as the Doc class, how can I till him hier that the //application is going to be finsihed and he must finsh the printing //of the last line of the Array? } }

    C / C++ / MFC c++ help tutorial question

  • How to terminate the secondary thread when the application closed?
    S susanne1

    Hallo, I have an application that uses a secondary thread to excute a very long function, what i need is, how to terminate the secondary thread "CLEANLY" if the main appliction is going to be closed while the seconndary thread is still excuting the verx long function? i started with : ON_WM_Close() in the View.cpp file, but i do not know how to continue: The secondary thread should become a Message if the the x or End in the Main application werde clicked. Please help(with code).

    C / C++ / MFC c++ help tutorial question

  • Thread
    S susanne1

    the thread mus t be created but not start immediately, autodelte false to tell him not to delet himself.

    C / C++ / MFC help

  • Thread
    S susanne1

    to wait for the event to happen.

    C / C++ / MFC help

  • Thread
    S susanne1

    Okay i did it like that defining the Thread Pointer in the header File, but this deos not help.

    C / C++ / MFC help

  • Thread
    S susanne1

    Hallo, I have the following problem with the Thread: I create the Thread first as SUSPENDED, but it does not start at the expectetd time. First the Program calls this function: ThreadStart(); /////////////////////////////// ThreadStart() { if (m_pSelThread != NULL) { if (::WaitForSingleObject(m_pSelThread->m_hThread, 0) != WAIT_OBJECT_0) return; delete m_pSelThread; m_pSelThread = NULL; } ::WaitForSingleObject(m_SEl_Start_Event, 0); m_SEl_Start_Event.SetEvent (); // CEvent Object CWinThread* m_pSelThread = AfxBeginThread(ThreadFunktion, this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED); m_pSelThread->m_bAutoDelete = FALSE; m_pSelThread->ResumeThread(); } UINT ThreadFunktion ( LPVOID param ) { if (param == NULL) return -1; DoSomeThing(); return 0; } The Thread does not come to the UINT ThreadFunktion(LPVOID param). Any help would be appriciated.

    C / C++ / MFC help

  • UINT ThreadProc ( LPVOID param )
    S susanne1

    The question is when i pass (this) instead of (hwnd) to the ThreadProc function i get a crash. The question is above.

    C / C++ / MFC c++ question

  • UINT ThreadProc ( LPVOID param )
    S susanne1

    okoay but i have an application crash hier: #ifdef _DEBUG void CTestView::AssertValid() const { CView::AssertValid(); // application crash } #ifndef _WIN32_WCE void CTestView::Dump(CDumpContext& dc) const { CView::Dump(dc); } #endif #endif

    C / C++ / MFC c++ question

  • UINT ThreadProc(LPVOID param)
    S susanne1

    okay but i got an application crash hier: #ifdef _DEBUG void CTestView::AssertValid() const { CView::AssertValid(); } #ifndef _WIN32_WCE void CTestView::Dump(CDumpContext& dc) const { CView::Dump(dc); } #endif #endif

    C / C++ / MFC help c++ question

  • UINT ThreadProc ( LPVOID param )
    S susanne1

    Hello, i tried it the way you said, but it did not work , maybe i did something wrong, hier is the code: void CTestView::ThreadStart(CTestDoc* pDoc, CString strSel) { m_Thread_Sel_Start.SetEvent (); HWND hWnd = GetSafeHwnd(); m_strSelect = strSel; m_pDoc = pDoc;// i need to access the CTestDoc.cpp, i passed pDoc from the CTestDoc.cpp to the CTestView.cpp // and then assigend pDoc to m_pDoc which defined in the top of the CTestView.cpp AfxBeginThread(ThreadProc, this/*hWnd*/, THREAD_PRIORITY_NORMAL);// Hier i passed this to the ThreadProc function } UINT ThreadProc ( LPVOID param ) { (CTestView*)param-> // casting to CTestView did not work? return 0; }

    C / C++ / MFC c++ question
  • Login

  • Don't have an account? Register

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