Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difficulty opening Com port using CreateFile

Status
Not open for further replies.

sjmolloy

Programmer
Aug 23, 2001
14
GB
I am trying to open a Com port using the following Code:
CComPort aCD;
aCD.m_hComm=CreateFile(aCD.m_cgzPort,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);

Unfortunately, something is going wrong and it is failing to open.
I am using GetLastError to find out what is going wrong and this is giving me the error:
"System cannot find the specified path".
This would make sense to me if it was an actual file I was opening but what does it mean when it is a Com port you are trying to open ??
Can anybody throw some light on this ?? Is my Com port set up wrong or what ???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top