comp.os.mswindows.programmer.win32
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.win32 only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007    
total
comp.os ... win32 Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: First time opening COM port using CreateFile         


Author: Owen Ransen
Date: Jan 26, 2008 23:29

On Sat, 26 Jan 2008 14:37:21 -0800 (PST), pedronf65@gmail.com wrote:
>I use this line of code:
>m_hFile = ::CreateFile(m_csCommPortName, GENERIC_READ | GENERIC_WRITE,
>0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);

It is a long times since I used this code, but you might
find something useful in it (especially the TRACE statements
after GetCommState() :

char gszPort [_MAX_PATH+1] = "COM2" ;
HANDLE hComm;
hComm = CreateFile( gszPort,
GENERIC_READ | GENERIC_WRITE,
0,
0,
OPEN_EXISTING,
0,// FILE_FLAG_OVERLAPPED,
0);
Show full article (1.37Kb)
7 Comments