Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to create and delete directory from MFC? Pin
Garth J Lancaster19-Dec-03 14:11
professionalGarth J Lancaster19-Dec-03 14:11 
AnswerRe: how to create and delete directory from MFC? Pin
John M. Drescher19-Dec-03 14:55
John M. Drescher19-Dec-03 14:55 
AnswerRe: how to create and delete directory from MFC? Pin
Shanmuga Sundar19-Dec-03 20:23
Shanmuga Sundar19-Dec-03 20:23 
GeneralDetecting Low Disk Space Pin
me19-Dec-03 12:21
me19-Dec-03 12:21 
GeneralRe: Detecting Low Disk Space Pin
Monty220-Dec-03 0:24
Monty220-Dec-03 0:24 
Questionhow to fix Toolbars area Pin
vancouver77719-Dec-03 9:40
vancouver77719-Dec-03 9:40 
AnswerRe: how to fix Toolbars area Pin
twing21-Dec-03 15:20
twing21-Dec-03 15:20 
Generalhelp with CSerial (code included) Pin
oh4u2nv19-Dec-03 9:28
oh4u2nv19-Dec-03 9:28 
i'm trying to communicate with a relay box connected with a serial cable. you send a command of N1 to open the first relay, N2 to open the second, etc... i've tested it with hyperterminal and it works fine. i'm usin a c++ mfc app in vs.net03. i've just added code to my program, if there are any settings that i have to set, then i don't know about them. i'm using the CSerial class
http://www.codeproject.com/system/serial.asp
portName and relay are both CStrings. anyone know what's wrong??

CSerial link;

link.Open(portName); //either COM1 or COM2
//set the port settings
link.Setup(CSerial::EBaudrate(9600), CSerial::EDataBits(,
CSerial::EParity(NOPARITY), CSerial::EStopBits(ONESTOPBIT));

if(relay[0]=='1')
relay.Delete(0,1);
link.Write(relay); //writing "N1" or whatever
//find time for pump to stay open
runtime=drinklist[num].amount[x]*MULTIPLIER;
Sleep(runtime*1000);
relay.Delete(0,1);
relay.Insert(0,"F");
link.Write(relay);
link.Close();


thanx



GeneralRe: help with CSerial (code included) Pin
John R. Shaw19-Dec-03 11:51
John R. Shaw19-Dec-03 11:51 
GeneralRe: help with CSerial (code included) Pin
oh4u2nv20-Dec-03 13:19
oh4u2nv20-Dec-03 13:19 
GeneralRe: help with CSerial (code included) Pin
John R. Shaw20-Dec-03 16:02
John R. Shaw20-Dec-03 16:02 
GeneralRe: help with CSerial (code included) Pin
Deepa Gopal19-Feb-04 23:16
Deepa Gopal19-Feb-04 23:16 
GeneralRe: help with CSerial (code included) Pin
John R. Shaw1-Mar-04 14:44
John R. Shaw1-Mar-04 14:44 
GeneralGetting path from Registry Key Handle Pin
imranhabib19-Dec-03 8:17
imranhabib19-Dec-03 8:17 
GeneralRe: Getting path from Registry Key Handle Pin
pankajdaga19-Dec-03 23:10
pankajdaga19-Dec-03 23:10 
GeneralRe: Getting path from Registry Key Handle Pin
imranhabib20-Dec-03 1:39
imranhabib20-Dec-03 1:39 
GeneralRe: Getting path from Registry Key Handle Pin
imranhabib5-Jan-04 5:41
imranhabib5-Jan-04 5:41 
Generallinking with a library Pin
karteek19-Dec-03 6:24
karteek19-Dec-03 6:24 
GeneralRe: linking with a library Pin
jmkhael19-Dec-03 6:29
jmkhael19-Dec-03 6:29 
GeneralRe: linking with a library Pin
Anonymous19-Dec-03 12:15
Anonymous19-Dec-03 12:15 
GeneralCListCtrl Problem Pin
Rassul Yunussov19-Dec-03 6:18
Rassul Yunussov19-Dec-03 6:18 
GeneralRe: CListCtrl Problem Pin
John R. Shaw19-Dec-03 12:13
John R. Shaw19-Dec-03 12:13 
GeneralRe: CListCtrl Problem Pin
Rassul Yunussov19-Dec-03 20:06
Rassul Yunussov19-Dec-03 20:06 
GeneralRe: CListCtrl Problem Pin
John R. Shaw20-Dec-03 15:07
John R. Shaw20-Dec-03 15:07 
GeneralAbout sound... Pin
Weiye Chen19-Dec-03 6:12
Weiye Chen19-Dec-03 6:12 

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.