Click here to Skip to main content
15,905,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to run a thread as a member function of a class? Pin
Eytukan14-Jun-05 3:45
Eytukan14-Jun-05 3:45 
AnswerRe: How to run a thread as a member function of a class? Pin
Bob Stanneveld14-Jun-05 4:08
Bob Stanneveld14-Jun-05 4:08 
GeneralRe: How to run a thread as a member function of a class? Pin
Eytukan14-Jun-05 1:43
Eytukan14-Jun-05 1:43 
GeneralRe: How to run a thread as a member function of a class? Pin
Bob Stanneveld14-Jun-05 1:49
Bob Stanneveld14-Jun-05 1:49 
GeneralRe: How to run a thread as a member function of a class? Pin
Eytukan14-Jun-05 1:55
Eytukan14-Jun-05 1:55 
GeneralRe: How to run a thread as a member function of a class? Pin
Eytukan14-Jun-05 2:06
Eytukan14-Jun-05 2:06 
GeneralRe: How to run a thread as a member function of a class? Pin
David Crow14-Jun-05 2:20
David Crow14-Jun-05 2:20 
GeneralRe: How to run a thread as a member function of a class? Pin
Bob Stanneveld14-Jun-05 21:17
Bob Stanneveld14-Jun-05 21:17 
Hello,

Sorry for this late reply..

A couple of things:
<list>
  • You pass a pointer x, that points to a MyWindow object to the thread as parameter, but you don't use it in either of your threads..
  • You call AfxGetApp() to get the value of m_pMainWnd
  • Your main app window is x
  • MyWindow derives from Test
    Thinking about all these things don't ring a bell? Anyway, what you want to achieve can be done in at least the following 2 ways:
    static_cast<MyWindow*>(AfxGetApp()->m_pMainWnd)->Text;

    static_cast<MyWindow*>(lp)->Text;


    Hope this helps Big Grin | :-D

    Behind every great black man...
                ... is the police. - Conspiracy brother


    Blog[^]

  • AnswerRe: How to run a thread as a member function of a class? Pin
    Cedric Moonen14-Jun-05 1:57
    Cedric Moonen14-Jun-05 1:57 
    AnswerRe: How to run a thread as a member function of a class? Pin
    Michael Dunn14-Jun-05 4:21
    sitebuilderMichael Dunn14-Jun-05 4:21 
    GeneralRe: How to run a thread as a member function of a class? Pin
    Eytukan14-Jun-05 2:14
    Eytukan14-Jun-05 2:14 
    Generali'm Noosed down by the THREADS!! Pin
    Eytukan14-Jun-05 2:25
    Eytukan14-Jun-05 2:25 
    GeneralSolution for the thread Pin
    Eytukan15-Jun-05 6:11
    Eytukan15-Jun-05 6:11 
    AnswerRe: How to run a thread as a member function of a class? Pin
    Paul Steane14-Jun-05 19:28
    Paul Steane14-Jun-05 19:28 
    Generalplease check out this link Pin
    Eytukan15-Jun-05 6:20
    Eytukan15-Jun-05 6:20 
    GeneralCreate an application to clear Heap Memory Pin
    Member 137164714-Jun-05 3:36
    Member 137164714-Jun-05 3:36 
    GeneralRe: Create an application to clear Heap Memory Pin
    David Crow14-Jun-05 1:35
    David Crow14-Jun-05 1:35 
    GeneralRe: Create an application to clear Heap Memory Pin
    Anonymous14-Jun-05 6:34
    Anonymous14-Jun-05 6:34 
    QuestionHelp Me! How to access a file with filename have space letters? Pin
    lewislewis_lewis14-Jun-05 3:35
    lewislewis_lewis14-Jun-05 3:35 
    AnswerRe: Help Me! How to access a file with filename have space letters? Pin
    David Crow14-Jun-05 1:28
    David Crow14-Jun-05 1:28 
    Generalerror code is 18 Pin
    lewislewis_lewis14-Jun-05 4:59
    lewislewis_lewis14-Jun-05 4:59 
    GeneralRe: error code is 18 Pin
    David Crow14-Jun-05 2:05
    David Crow14-Jun-05 2:05 
    GeneralYES! Pin
    lewislewis_lewis14-Jun-05 5:26
    lewislewis_lewis14-Jun-05 5:26 
    GeneralRe: YES! Pin
    David Crow14-Jun-05 5:49
    David Crow14-Jun-05 5:49 
    GeneralIf I get FileURL, Every thing is OK. Pin
    lewislewis_lewis14-Jun-05 8:01
    lewislewis_lewis14-Jun-05 8:01 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.