Click to See Complete Forum and Search --> : VC/MFC/WinAPI - Modem


erany
January 11th, 2004, 06:42 AM
Hi,

For the past few days, i am looking for a way to create an app which uses the modem. so far NULL results on how to use the modem on VC++.

any help will be great.

hinksj
January 11th, 2004, 04:50 PM
Just a few pointers:

Open a COM Port using CreateFile();
Set Baud Rate using SetCommState();
Write to it using WriteFile() ... use "AT command set".

Good Luck.

CJ1
January 12th, 2004, 11:15 AM
Just a little more detail:

When opening the file, you must use the OPEN_EXISTING for the dwCreationDisposition parameter and you should at most use FILE_SHARE_READ for the dwFileShare parameter.

The first one is required or the call will fail, the second will prevent another app from writing to the comm port and messing up your session.