1 // Test program for serial communication. Visual C / MFC Version
2 // Bela Torok / bela.torok@kssg.ch, March 2001
4 #include <afxwin.h> // Defines the entry point for the console application.
11 int main(int argc, char* argv[])
16 int ComPortNumber = 1;
18 hComPort = SerialInit("com1", 1200); // 1200 Baud
21 printf("\n\nError initializing %s!\n", "com1");
25 // write string to RS232
26 SerialPuts(&hComPort, "\nInitialize\n");
29 // read string from RS232
30 printf("\nString received: %s\n", SerialGets(&hComPort));
32 CloseHandle(hComPort);