Multithreading in MFC and output

This is a discussion on Multithreading in MFC and output within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, I have a read only edit box which i use as an output in my code CString output ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    15

    Multithreading in MFC and output

    Hi all,
    I have a read only edit box which i use as an output in my code

    CString output

    Now , I want to be able to start up a new thread and then write to output. I've set up a static function in my class

    static UINT test_func(LPVOID pParam)

    and function definition is

    static UINT CTransmitterDlg::test_func(LPVOID pParam)

    output+="in here\r\n";
    return 1;


    I call the test_func from another function by the following
    AfxBeginThread(test_func,NULL);


    However, I get compiler errors for all of this
    error C2724: 'test_func' : 'static' should not be used on member functions defined at file scope
    error C2597: illegal reference to data member 'CTransmitterDlg:utput' in a static member function


    Does anyone know of a solution to this and/or some way that I can write to this output from a new thread. Thanks
    Shav

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    15
    It's ok all, I just let output be a global variable and it works fine. Thanks anyway

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. IPC between MFC and .NET
    By khdani in forum Windows Programming
    Replies: 2
    Last Post: 02-26-2009, 05:39 PM
  2. Funny output on hex value of number
    By shav in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 08:19 AM
  3. MFC Errors :: C++
    By kuphryn in forum C++ Programming
    Replies: 3
    Last Post: 02-11-2002, 09:46 AM
  4. HELP ME PLEASE! mfc and C++
    By paranoidandroid in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2001, 04:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21