Click here to Skip to main content
15,920,641 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multiple user with CDaoRecordset Pin
Ariel22-Feb-01 3:36
Ariel22-Feb-01 3:36 
GeneralString Table & Resource IDs Pin
15-Jan-01 7:28
suss15-Jan-01 7:28 
QuestionHow to print a loaded image in a Dialog Box? Pin
15-Jan-01 5:24
suss15-Jan-01 5:24 
AnswerRe: How to print a loaded image in a Dialog Box? Pin
Christian Graus15-Jan-01 8:18
protectorChristian Graus15-Jan-01 8:18 
GeneralTimer Selection Pin
.::RockNix::.15-Jan-01 4:19
.::RockNix::.15-Jan-01 4:19 
GeneralRe: Timer Selection Pin
Erik Funkenbusch15-Jan-01 11:41
Erik Funkenbusch15-Jan-01 11:41 
GeneralRe: Timer Selection Pin
.::RockNix::.16-Jan-01 1:07
.::RockNix::.16-Jan-01 1:07 
GeneralThreads problem Pin
15-Jan-01 3:13
suss15-Jan-01 3:13 
Hi,

I use Visual C++ 6.0 and i need help for the following problem.

In my App, i have two command button. The first button send some instructions
like this :

bool NoData=false;
while(1)
{
.....
OpenPort(PortId); // Open a port com ( for exemple com2)
WriteFile(.......); // Write to port com
.....
if(NoData)
{
ClosePort(PortId); //Close port com
break;
}
}

While my Button 1 send theses commands, i want to use button 2 to stop
this operation before Variable NoData is true.
To do this i try to close directly port com :

ClosePort(PortId); //Close port com

But it don't work, because i can press button 2 during this operation.


Is anybody can help me How can i use two threads to do this

Thanks in advance

GeneralRe: Threads problem Pin
Ghazi H. Wadi15-Jan-01 4:08
Ghazi H. Wadi15-Jan-01 4:08 
Generalchange user in a MS ACCESS DB under MFC Pin
15-Jan-01 1:17
suss15-Jan-01 1:17 
GeneralShared Singleton between EXE and DLL Pin
Jason Douglas15-Jan-01 1:10
professionalJason Douglas15-Jan-01 1:10 
GeneralRe: Shared Singleton between EXE and DLL Pin
Ghazi H. Wadi16-Jan-01 9:44
Ghazi H. Wadi16-Jan-01 9:44 
GeneralCDaoRecordset & Access2000 Pin
jerry0davis14-Jan-01 22:26
jerry0davis14-Jan-01 22:26 
GeneralRe: CDaoRecordset & Access2000 Pin
Anders Molin14-Jan-01 23:54
professionalAnders Molin14-Jan-01 23:54 
GeneralRe: CDaoRecordset & Access2000 Pin
jerry0davis15-Jan-01 2:54
jerry0davis15-Jan-01 2:54 
GeneralRe: CDaoRecordset & Access2000 Pin
jerry0davis17-Jan-01 1:35
jerry0davis17-Jan-01 1:35 
GeneralRe: CDaoRecordset & Access2000 Pin
Anders Molin17-Jan-01 1:44
professionalAnders Molin17-Jan-01 1:44 
GeneralRe: CDaoRecordset & Access2000 Pin
jerry0davis17-Jan-01 2:39
jerry0davis17-Jan-01 2:39 
GeneralRe: CDaoRecordset & Access2000 Pin
Anders Molin17-Jan-01 1:47
professionalAnders Molin17-Jan-01 1:47 
GeneralRichEditCtrl Pin
14-Jan-01 18:51
suss14-Jan-01 18:51 
GeneralRe: RichEditCtrl Pin
14-Jan-01 19:09
suss14-Jan-01 19:09 
GeneralRe: RichEditCtrl Pin
Erik Funkenbusch15-Jan-01 11:51
Erik Funkenbusch15-Jan-01 11:51 
GeneralRe: RichEditCtrl Pin
16-Jan-01 9:51
suss16-Jan-01 9:51 
GeneralRe: RichEditCtrl Pin
16-Jan-01 9:52
suss16-Jan-01 9:52 
GeneralRe: RichEditCtrl Pin
Erik Funkenbusch16-Jan-01 12:19
Erik Funkenbusch16-Jan-01 12:19 

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.