CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: @EE@

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: stop a thread

    by @EE@
    Replies
    6
    Views
    656

    Re: stop a thread

    that link has good information on thread controls. However, it does not cover cases when thread is running and by click of a button, thread is terminated which is not recommended by many. Usually...
  2. Thread: stop a thread

    by @EE@
    Replies
    6
    Views
    656

    stop a thread

    a thread is running. how to cleanly stop m_thread from running regardless what it is doing.


    m_thread=AfxBeginThread(RunThread, (aDlg*)this);
    if (m_thread)
    {
    DWORD dwRet;
    do
    {
    dwRet =...
  3. Thread: refresh dialog

    by @EE@
    Replies
    7
    Views
    678

    Re: refresh dialog

    thanks for the link. useful.
  4. Thread: refresh dialog

    by @EE@
    Replies
    7
    Views
    678

    Re: refresh dialog

    Victor:

    1. And what are the reasons you "can not use worker thread for this function"?

    need something more deterministic. The thread operation does not quite sync with operation in the library...
  5. Thread: refresh dialog

    by @EE@
    Replies
    7
    Views
    678

    refresh dialog

    Have a function as part of a dialog class which has some loops and so on and works. But during its run, the dialog needs its controls , etc. refreshed and update. For reasons can not use worker...
  6. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    Re: App crash

    1. yes, this thread simply returns. No even driven exit is used.
    2. Like may typical examples, this library is Initialized for providing callback function. library has exit routine that gets called...
  7. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    Re: App crash

    the thread includes a series of steps till it returns. The first step is to initialize the library. I moved it out of the thread and seems to resolve it. Not 100% sure yet. Need to do more testing....
  8. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    Re: App crash

    this is the code i use to check for thread exit.

    void CMyDlg::OnBnClickedButton()
    {
    m_pWinThread = AfxBeginThread(MyThreadFunc, (LPVOID)this);

    DWORD ret;
    do
    {
    ret =...
  9. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    Re: App crash

    How many threads are started in your application?

    in one of the tabs only when a button is clicked on.

    Does the every tab dialog start the thread?

    click on a button

    How did you check...
  10. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    Re: App crash

    only one thread get started in one of the tabs by clicking on a button. the rest are regular buttons.
  11. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    Re: App crash

    my application is multi tab application which uses tab tree control. The APPCRASH may not be related to start of the thread. I could not see any memory lean risk code. I use CREATE for each dialog in...
  12. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    Re: App crash

    this is the way I start my thread and get going to the end.
    https://www.codeproject.com/Articles/2855/Waiting-for-a-thread-to-terminate
  13. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    Re: App crash

    after thread exits. After all processing done. After X on the top right is clicked on to close the APP. After APP apparently closed, After a few seconds, it launches again on its own. checked the...
  14. Thread: App crash

    by @EE@
    Replies
    15
    Views
    1,039

    App crash

    VS2015 mfc app with a button click launches a thread. After thread exists and dialog's X on top right is clicked on, it closes and re-launches. The event viewer shows the event name APPCRASH. problem...
  15. Replies
    5
    Views
    485

    Re: worker thread access UI controls

    is it safe for the thread to call non UI member function of the Dialog that launched it?.

    void CMyDlg::callme() //this is not part of UI. just a member of the Dialog
    {
    ///....
    }

    .......
  16. Replies
    5
    Views
    485

    Re: worker thread access UI controls

    I know How to set a value to a UI control using postmessage but not reading it? How use the postmssage to read value from UI textbox?.
    I have used sendmessage to invoke a button on UI. Is this...
  17. Replies
    5
    Views
    485

    worker thread access UI controls

    I have not dealt with threads and got stock with writing an app for data acquisition experiments.
    1) A thread launched by AfxThreadBegin, could it access Dialog controls and members for read only?....
  18. Replies
    10
    Views
    1,199

    Re: wait .. no blocking

    why you do not use std::threads?. What are other alternatives based on your experiences?. Specially for passing array of objects to it in C++. I read _beginthread(ex) are appropriate for C++.
  19. Replies
    10
    Views
    1,199

    Re: wait .. no blocking

    This is what I mean?. Condition variables versus events.. ?
    https://en.cppreference.com/w/cpp/thread/condition_variable
  20. Replies
    10
    Views
    1,199

    Re: wait .. no blocking

    how about condition variables versus events?. Both work at kernel level?. Which is more proper to use?.
  21. Replies
    10
    Views
    1,199

    wait .. no blocking

    need examples of a proper way to wait for a flag change in another thread without blocking the events?. In C++/windows.
  22. Thread: array of objects

    by @EE@
    Replies
    14
    Views
    1,817

    Re: array of objects

    thank you 2kaud and others.
  23. Thread: array of objects

    by @EE@
    Replies
    14
    Views
    1,817

    Re: array of objects

    Is there a reason why the SetThreadPriority is removed by 2Kaud?. Maybe it is not genuine c++?? may actually run faster without it??.
    is the "writetoFile" thread safe?. I like to make sure the each...
  24. Thread: array of objects

    by @EE@
    Replies
    14
    Views
    1,817

    Re: array of objects

    I added threads to my array of objects. It crashes when main exits. Also, static member gives an error. not sure how to handle these two cases?.


    #include <iostream>
    #include <vector>
    #include...
  25. Replies
    4
    Views
    736

    Re: threads and function call

    Got multiple threads each with an instance of a class accessing a function Add. In what cases that kind of a function would be unsafe if accesses by multiple threads?. examples?.. I got to do more...
Results 1 to 25 of 45
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured