Click here to Skip to main content
15,886,799 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to get Tooltip with close[x] icon in it Pin
Hamid_RT10-Aug-06 21:26
Hamid_RT10-Aug-06 21:26 
QuestionGZIP wrapper? Pin
Peter Weyzen10-Aug-06 19:18
Peter Weyzen10-Aug-06 19:18 
AnswerRe: GZIP wrapper? Pin
Programm3r10-Aug-06 21:12
Programm3r10-Aug-06 21:12 
GeneralRe: GZIP wrapper? Pin
Peter Weyzen10-Aug-06 23:21
Peter Weyzen10-Aug-06 23:21 
AnswerRe: GZIP wrapper? Pin
Hamid_RT10-Aug-06 21:37
Hamid_RT10-Aug-06 21:37 
AnswerRe: GZIP wrapper? Pin
Justin Tay10-Aug-06 23:11
Justin Tay10-Aug-06 23:11 
GeneralRe: GZIP wrapper? Pin
Peter Weyzen10-Aug-06 23:19
Peter Weyzen10-Aug-06 23:19 
QuestionWriting to serial port problem. [modified] Pin
VCSharp00710-Aug-06 18:31
VCSharp00710-Aug-06 18:31 
Hi,
I had got an error as "Invalid handle specified" while trying write to a serial port(COM1)using WriteFile().
But the handle to serial port is seems to be valid.
One by one step I had followed is below.

Step 1: Create a connection
HANDLE hSerial = CreateFile( "COM1",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL ,NULL);


Step 2: Configure the settings
DCB db;
memset( &db,0,sizeof(db));
db.DCBlength = sizeof(db);
if( ! GetCommState( hSerial, &db ))
{
return;
}

if( ! SetCommState( hSerial, &db ) )
{
DWORD dw = GetLastError();
return;
}



Step 3:
DWORD dwWritten;
OVERLAPPED or;

if( WriteFile( hSerial, "Write", 6, &dwWritten, &or ))
{
AfxMessageBox( "Write Success!!!");
}



Step1 and Step2 are successfully executed.
But step3 returns an "Invalid handle specified" error.


What may be prob?

Thanx in Advance.


-- modified at 0:33 Friday 11th August, 2006
AnswerRe: Writing to serial port problem. Pin
Cedric Moonen10-Aug-06 20:23
Cedric Moonen10-Aug-06 20:23 
AnswerRe: Writing to serial port problem. [modified] Pin
kakan10-Aug-06 20:54
professionalkakan10-Aug-06 20:54 
GeneralRe: Writing to serial port problem. Pin
VCSharp00710-Aug-06 21:26
VCSharp00710-Aug-06 21:26 
GeneralRe: Writing to serial port problem. Pin
kakan10-Aug-06 22:02
professionalkakan10-Aug-06 22:02 
GeneralRe: Writing to serial port problem. [modified] Pin
VCSharp00711-Aug-06 1:03
VCSharp00711-Aug-06 1:03 
GeneralRe: Writing to serial port problem. Pin
kakan11-Aug-06 3:43
professionalkakan11-Aug-06 3:43 
QuestionTo stop the flash? [modified] Pin
mimimimilaw10-Aug-06 17:33
mimimimilaw10-Aug-06 17:33 
AnswerRe: To stop the flash? Pin
sujtha10-Aug-06 18:49
sujtha10-Aug-06 18:49 
QuestionRe: To stop the flash? Pin
Hamid_RT10-Aug-06 21:33
Hamid_RT10-Aug-06 21:33 
Questionset window size by user??? Pin
mimimimilaw10-Aug-06 15:53
mimimimilaw10-Aug-06 15:53 
AnswerRe: set window size by user??? Pin
mails2dhana10-Aug-06 17:50
mails2dhana10-Aug-06 17:50 
AnswerRe: set window size by user??? Pin
Hamid_RT10-Aug-06 21:33
Hamid_RT10-Aug-06 21:33 
QuestionNewbie - Various Compiler Errors Pin
alias4710-Aug-06 15:01
alias4710-Aug-06 15:01 
AnswerRe: Newbie - Various Compiler Errors Pin
Christian Graus10-Aug-06 19:56
protectorChristian Graus10-Aug-06 19:56 
QuestionVisualizations development Pin
Mohammad A Gdeisat10-Aug-06 10:52
Mohammad A Gdeisat10-Aug-06 10:52 
AnswerRe: Visualizations development Pin
Christian Graus10-Aug-06 12:25
protectorChristian Graus10-Aug-06 12:25 
GeneralRe: Visualizations development Pin
Mohammad A Gdeisat10-Aug-06 12:33
Mohammad A Gdeisat10-Aug-06 12:33 

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.