Click here to Skip to main content
16,008,490 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to add me menu bar in MFC application.. Pin
Hamid_RT22-May-06 19:20
Hamid_RT22-May-06 19:20 
Questionchange colors of controls Pin
kumar_mk22-May-06 18:05
kumar_mk22-May-06 18:05 
AnswerRe: change colors of controls Pin
Laxman Auti22-May-06 18:22
Laxman Auti22-May-06 18:22 
GeneralRe: change colors of controls Pin
Nibu babu thomas22-May-06 18:33
Nibu babu thomas22-May-06 18:33 
AnswerRe: change colors of controls Pin
Ganesh_T22-May-06 18:30
Ganesh_T22-May-06 18:30 
AnswerRe: change colors of controls [modified] Pin
Nibu babu thomas22-May-06 18:39
Nibu babu thomas22-May-06 18:39 
AnswerRe: change colors of controls Pin
Hamid_RT22-May-06 19:16
Hamid_RT22-May-06 19:16 
Questionread serial port automatically?? Pin
Nawar_nrr22-May-06 18:03
Nawar_nrr22-May-06 18:03 
hi .. Im writing a multithreadedprogram in borland c++ builder 6 that communicate with serial port..readFile function is on a seperate thread and its called ( the thread) by
void __fastcall read_thrd::Execute() (which replace the thread function..)..so how can I write a function that reads the serial port automatically when there is something??..(how to get the serial port status(or whatever) and react to it?)

Execute() could be controled by Resume() - will resume its execution- and Suspend() - will pause and suspend its execution- and those two functions are the way to communicate with the thread from the main thread -in addition to Terminate()- , so I can write my code in execute() or in other function and then call it.

now my code it as simple as this: (Im using a butten to call resume)


<br />
//thread is suspended when created<br />
void __fastcall read_thrd::Execute()<br />
{<br />
FreeOnTerminate = true;<br />
while(!Terminated)<br />
{<br />
  ReadFile(Form1->m_hCom, &(Form1->sBuffer), 128, &(Form1->iBytesWritten), &osReader) ;<br />
  Suspend();<br />
}<br />
<br />
if(Terminated)<br />
{<br />
void __endthread(void);<br />
}<br />
}


I need to replace it ..so I dont have to click the butten to read the comm port..can you help??please?
Questionconstructor related questions Pin
kumar_mk22-May-06 17:51
kumar_mk22-May-06 17:51 
AnswerRe: constructor related questions Pin
Ryan Binns22-May-06 18:23
Ryan Binns22-May-06 18:23 
AnswerRe: constructor related questions Pin
Laxman Auti22-May-06 18:38
Laxman Auti22-May-06 18:38 
Questionhow to system dpi in code Pin
chethu66522-May-06 17:16
chethu66522-May-06 17:16 
AnswerRe: how to system dpi in code Pin
_AnsHUMAN_ 22-May-06 17:59
_AnsHUMAN_ 22-May-06 17:59 
AnswerRe: how to system dpi in code Pin
Ryan Binns22-May-06 18:25
Ryan Binns22-May-06 18:25 
QuestionIOCompletion port basic question Pin
followait22-May-06 17:15
followait22-May-06 17:15 
AnswerRe: IOCompletion port basic question Pin
bob1697222-May-06 18:39
bob1697222-May-06 18:39 
QuestionProblem adding control buttons in a Cformview class dialog page Pin
thathvamsi22-May-06 16:47
thathvamsi22-May-06 16:47 
AnswerRe: Problem adding control buttons in a Cformview class dialog page Pin
Nibu babu thomas22-May-06 18:15
Nibu babu thomas22-May-06 18:15 
GeneralRe: Problem adding control buttons in a Cformview class dialog page Pin
thathvamsi22-May-06 18:19
thathvamsi22-May-06 18:19 
AnswerRe: Problem adding control buttons in a Cformview class dialog page Pin
Ryan Binns22-May-06 18:27
Ryan Binns22-May-06 18:27 
AnswerRe: Problem adding control buttons in a Cformview class dialog page Pin
Hamid_RT22-May-06 19:43
Hamid_RT22-May-06 19:43 
QuestionFAQ for an interview in Multithreading/C++ Pin
AryaSoft22-May-06 16:05
AryaSoft22-May-06 16:05 
AnswerRe: FAQ for an interview in Multithreading/C++ Pin
kumar_mk22-May-06 17:46
kumar_mk22-May-06 17:46 
AnswerRe: FAQ for an interview in Multithreading/C++ Pin
AryaSoft23-May-06 7:45
AryaSoft23-May-06 7:45 
AnswerRe: FAQ for an interview in Multithreading/C++ Pin
Laxman Auti22-May-06 18:13
Laxman Auti22-May-06 18:13 

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.