Click here to Skip to main content
15,908,673 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Float value Pin
Dr.Walt Fair, PE15-Nov-10 5:14
professionalDr.Walt Fair, PE15-Nov-10 5:14 
AnswerRe: Float value Pin
David Crow15-Nov-10 5:41
David Crow15-Nov-10 5:41 
GeneralRe: Float value Pin
Sauro Viti15-Nov-10 9:12
professionalSauro Viti15-Nov-10 9:12 
AnswerRe: Float value Pin
Rick York17-Nov-10 7:36
mveRick York17-Nov-10 7:36 
QuestionProblem with HtmlHelp API Pin
msr_codeproject15-Nov-10 0:03
msr_codeproject15-Nov-10 0:03 
AnswerRe: Problem with HtmlHelp API Pin
Randor 15-Nov-10 2:28
professional Randor 15-Nov-10 2:28 
QuestionCompilation Error Pin
john563214-Nov-10 20:24
john563214-Nov-10 20:24 
AnswerRe: Compilation Error Pin
Cedric Moonen14-Nov-10 20:45
Cedric Moonen14-Nov-10 20:45 
GeneralRe: Compilation Error Pin
CPallini14-Nov-10 21:17
mveCPallini14-Nov-10 21:17 
GeneralRe: Compilation Error Pin
Cedric Moonen14-Nov-10 21:20
Cedric Moonen14-Nov-10 21:20 
AnswerRe: Compilation Error Pin
Richard MacCutchan14-Nov-10 23:07
mveRichard MacCutchan14-Nov-10 23:07 
QuestionHow can access the same port by diffreant threads at same time? Pin
Le@rner14-Nov-10 20:12
Le@rner14-Nov-10 20:12 
AnswerRe: How can access the same port by diffreant threads at same time? Pin
Cedric Moonen14-Nov-10 20:49
Cedric Moonen14-Nov-10 20:49 
GeneralRe: How can access the same port by diffreant threads at same time? Pin
Le@rner14-Nov-10 21:22
Le@rner14-Nov-10 21:22 
GeneralRe: How can access the same port by diffreant threads at same time? Pin
Cedric Moonen14-Nov-10 21:31
Cedric Moonen14-Nov-10 21:31 
GeneralRe: How can access the same port by diffreant threads at same time? Pin
Le@rner14-Nov-10 21:33
Le@rner14-Nov-10 21:33 
GeneralRe: How can access the same port by diffreant threads at same time? Pin
CPallini14-Nov-10 21:53
mveCPallini14-Nov-10 21:53 
GeneralRe: How can access the same port by diffreant threads at same time? Pin
Cedric Moonen14-Nov-10 21:59
Cedric Moonen14-Nov-10 21:59 
Ok, it is for writing the port, not reading the port then. In that case, I think it is a bit more easier. Anyway, you still need to same principle: the thread that writes to the port creates a queue in which the other threads can push their messages. The access to the queue is protected by critical sections, so that multiple threads cannot write data at the same time in the queue.

To make things a bit easier, you will first need to wrap the SMS data into a specific class (makes it easier to manipulate). Then, you will need to create the queue class: to make things a bit more simple for now, this queue wraps a std::queue with the type of your SMS class. You'll then need to secure the access to the internal queue by using critical section.

After a bit of googling, I found this implementation[^] of a thread-safe queue. Try to understand the code first, then come here and ask specific questions about which part you didn't understand. Then, once you really understood how the code work, you can implement your own version of the queue.
Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

GeneralRe: How can access the same port by diffreant threads at same time? Pin
CPallini14-Nov-10 21:22
mveCPallini14-Nov-10 21:22 
Questionhow to display contents of a text file in EditBox?? [modified] Pin
MahaKh14-Nov-10 19:45
MahaKh14-Nov-10 19:45 
QuestionRe: how to display contents of a text file in EditBox?? Pin
CPallini14-Nov-10 21:28
mveCPallini14-Nov-10 21:28 
AnswerRe: how to display contents of a text file in EditBox?? Pin
Cool_Dev14-Nov-10 21:42
Cool_Dev14-Nov-10 21:42 
QuestionReadDirectoryChangesW failing Pin
Subrat Patnaik14-Nov-10 19:25
Subrat Patnaik14-Nov-10 19:25 
AnswerRe: ReadDirectoryChangesW failing Pin
Richard MacCutchan14-Nov-10 23:05
mveRichard MacCutchan14-Nov-10 23:05 
QuestionOpengl Multithreading (wglMakeCurrent() & wglShareLists() ) issue Pin
James_72214-Nov-10 18:32
James_72214-Nov-10 18:32 

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.