Click here to Skip to main content
16,006,605 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: what does "rhs" mean? Pin
hph17-Mar-04 4:28
hph17-Mar-04 4:28 
GeneralIncluding project files from library Pin
Cedric Moonen17-Mar-04 4:19
Cedric Moonen17-Mar-04 4:19 
GeneralOpenProcess Pin
hph17-Mar-04 4:03
hph17-Mar-04 4:03 
GeneralRe: OpenProcess Pin
gUrM33T17-Mar-04 14:57
gUrM33T17-Mar-04 14:57 
GeneralWindows NT Device Driver and PCI Bus access on Windows NT Pin
BhaskarBora17-Mar-04 3:57
BhaskarBora17-Mar-04 3:57 
QuestionHow to creat a graphical back ground and button on a dialog class in MFC? Pin
flow555517-Mar-04 2:58
flow555517-Mar-04 2:58 
AnswerRe: How to creat a graphical back ground and button on a dialog class in MFC? Pin
David Crow17-Mar-04 4:33
David Crow17-Mar-04 4:33 
GeneralSharing data among Threads Pin
Cedric Moonen17-Mar-04 2:44
Cedric Moonen17-Mar-04 2:44 
Hello all!

I have a project designed with the MFC document/view architecture. In the App idle time I read some data from a data source (I call a function of my doc class). This data will be displayed in a chart.
But I need also to make some computation on this data but I want to make this in a separate thread (the computation take some times and it cannot stop the reading of the data).
When I start the new Thread, I pass a pointer to my document so it can access data and the data will be stored in a buffer (FIFO buffer).
I was wondering if this is safe to do such a thing ?

Something like that:

BOOL CMyAppDoc::idle()
{
   // read data here
   pFIFOBuffer->AddData(Data);
}

And in the thread function:

//....
pMyDoc->ComputeData();
//...

void CMyAppDoc::ComputeData()
{
    while (TRUE)
        if (pFIFOBuffer->GetData(Data))
            ProcessData(Data);
}



Thanks
GeneralRe: Sharing data among Threads Pin
GuimaSun17-Mar-04 3:13
GuimaSun17-Mar-04 3:13 
GeneralRe: Sharing data among Threads Pin
Cedric Moonen17-Mar-04 3:31
Cedric Moonen17-Mar-04 3:31 
GeneralURL opens application Pin
Florin Ochiana17-Mar-04 1:49
Florin Ochiana17-Mar-04 1:49 
QuestionHow to use CheckMenuItem()???????? Pin
Anonymous17-Mar-04 1:46
Anonymous17-Mar-04 1:46 
AnswerRe: How to use CheckMenuItem()???????? Pin
Florin Ochiana17-Mar-04 2:00
Florin Ochiana17-Mar-04 2:00 
GeneralRe: How to use CheckMenuItem()???????? Pin
Anonymous17-Mar-04 2:10
Anonymous17-Mar-04 2:10 
GeneralRe: How to use CheckMenuItem()???????? Pin
Florin Ochiana17-Mar-04 2:19
Florin Ochiana17-Mar-04 2:19 
GeneralThank u very much!! Pin
Anonymous17-Mar-04 2:39
Anonymous17-Mar-04 2:39 
AnswerRe: How to use CheckMenuItem()???????? Pin
Maximilien17-Mar-04 2:33
Maximilien17-Mar-04 2:33 
Generalcin >> question Pin
ns17-Mar-04 1:16
ns17-Mar-04 1:16 
GeneralRe: cin >> question Pin
David Crow17-Mar-04 2:27
David Crow17-Mar-04 2:27 
GeneralRe: cin >> question Pin
Anonymous17-Mar-04 22:11
Anonymous17-Mar-04 22:11 
GeneralRe: cin >> question Pin
David Crow19-Mar-04 3:25
David Crow19-Mar-04 3:25 
GeneralProperty sheets and pages Pin
Anonymous17-Mar-04 0:56
Anonymous17-Mar-04 0:56 
GeneralRe: Property sheets and pages Pin
Nirav Doshi17-Mar-04 1:28
Nirav Doshi17-Mar-04 1:28 
GeneralRe: Property sheets and pages Pin
thowra17-Mar-04 1:52
thowra17-Mar-04 1:52 
GeneralDetecting if a print job failed Pin
tcss16-Mar-04 23:58
tcss16-Mar-04 23:58 

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.