Click here to Skip to main content
15,921,577 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to transfer data from one dialog box to another, Pin
Deepak Samuel26-Jul-03 6:39
Deepak Samuel26-Jul-03 6:39 
AnswerRe: How to transfer data from one dialog box to another, Pin
valikac26-Jul-03 7:01
valikac26-Jul-03 7:01 
AnswerRe: How to transfer data from one dialog box to another, Pin
User 665826-Jul-03 7:08
User 665826-Jul-03 7:08 
GeneralRe: How to transfer data from one dialog box to another, Pin
Febin Elizabeth15-Mar-09 23:06
Febin Elizabeth15-Mar-09 23:06 
GeneralHelp in COM Pin
Snyp26-Jul-03 6:35
Snyp26-Jul-03 6:35 
GeneralRe: Help in COM Pin
valikac26-Jul-03 7:02
valikac26-Jul-03 7:02 
GeneralRe: Help in COM Pin
Toni7826-Jul-03 7:35
Toni7826-Jul-03 7:35 
GeneralProblem with CommunicationPort Pin
soobot26-Jul-03 5:49
soobot26-Jul-03 5:49 
Dear Friend
I used file operation method to get a grip with communication port and as it's my first time I've lots of problem and couldn't continue so...
I'd be appreciated if you could advise me
Regards


BOOL CMainFrame::InitSerialPort()
{
DCB dcb;
BOOL fSuccess;
char *pcCommPort = "COM1";
m_hComPort = CreateFile( pcCommPort,
GENERIC_READ | GENERIC_WRITE,
0, // comm devices must be opened w/exclusive-access
NULL, // no security attributes
OPEN_EXISTING, // comm devices must use OPEN_EXISTING
0, // not overlapped I/O
NULL // hTemplate must be NULL for comm devices
);

if(m_hComPort == INVALID_HANDLE_VALUE)
{
// Handle the error.
CString str;
str.Format("CreateFile failed with error %d.\n", GetLastError());
AfxMessageBox(str);
return FALSE;
}
fSuccess = GetCommState(m_hComPort, &dcb);

if (!fSuccess)
{
// Handle the error.
CString str1;
str1.Format("CreateFile failed with error %d.\n", GetLastError());
AfxMessageBox(str1);
return FALSE;
}
dcb.BaudRate = CBR_9600; // set the baud rate
dcb.ByteSize = 8; // data size, xmit, and rcv
dcb.Parity = NOPARITY; // no parity bit
dcb.StopBits = ONESTOPBIT; // one stop bit

fSuccess = SetCommState(m_hComPort, &dcb);

if(!fSuccess) //////////// this line hs been repeated ////////
{
// Handle the error.
CString str2;
str.Format("CreateFile failed with error %d.\n", GetLastError());
AfxMessageBox(str2);
return FALSE;
}
return TRUE;
}
GeneralRe: Problem with CommunicationPort Pin
Toni7826-Jul-03 7:37
Toni7826-Jul-03 7:37 
GeneralProblem with openning CommPort Pin
soobot26-Jul-03 5:41
soobot26-Jul-03 5:41 
GeneralHyperlinks in a CTreeCtrl Pin
XP26-Jul-03 5:26
XP26-Jul-03 5:26 
GeneralRe: Hyperlinks in a CTreeCtrl Pin
Beer2626-Jul-03 6:49
Beer2626-Jul-03 6:49 
GeneralRe: Hyperlinks in a CTreeCtrl Pin
Andrew Schetinin26-Jul-03 8:29
Andrew Schetinin26-Jul-03 8:29 
QuestionPointer? Pin
wow999926-Jul-03 5:04
wow999926-Jul-03 5:04 
AnswerRe: Pointer? Pin
Maximilien26-Jul-03 5:10
Maximilien26-Jul-03 5:10 
GeneralRe: Pointer? Pin
wow999926-Jul-03 5:15
wow999926-Jul-03 5:15 
GeneralRe: Pointer? Pin
markkuk26-Jul-03 5:19
markkuk26-Jul-03 5:19 
GeneralRe: Pointer? Pin
geo_m26-Jul-03 5:20
geo_m26-Jul-03 5:20 
GeneralRe: Pointer? Pin
XP26-Jul-03 5:24
XP26-Jul-03 5:24 
AnswerRe: Pointer? Pin
wow999926-Jul-03 5:26
wow999926-Jul-03 5:26 
GeneralRe: Pointer? Pin
Maximilien26-Jul-03 5:42
Maximilien26-Jul-03 5:42 
GeneralRe: Pointer? Pin
Ravi Bhavnani26-Jul-03 7:28
professionalRavi Bhavnani26-Jul-03 7:28 
QuestionHow to block execution of GUI programs passed to command.com/cmd.exe Pin
nick4u26-Jul-03 3:47
nick4u26-Jul-03 3:47 
AnswerRe: How to block execution of GUI programs passed to command.com/cmd.exe Pin
spoulson26-Jul-03 4:55
spoulson26-Jul-03 4:55 
AnswerRe: How to block execution of GUI programs passed to command.com/cmd.exe Pin
Andrew Schetinin26-Jul-03 8:44
Andrew Schetinin26-Jul-03 8:44 

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.