Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


MSComm and Winsock control

Posted on 2003-03-11
Medium Priority
Last Modified: 2012-05-05

I need to use both winsock and mscomm control in my application. Simply put my application interacts with a router (TCP/IP) which replies, depending on the reply i need to set the control bit of the port on the machine where my application is running to 1 or 0 (I assume this will be done using MSComm control?). This is one of the jobs my application does. Now I am a bit zapped regarding where to start from. Any help/sample code/tutorial etc will help .. so please tell me where to look for and what to look for.
Thanks a ton

Question by:singhshweta
1 Comment
LVL 27

Accepted Solution

BigRat earned 400 total points
ID: 8151217
The MSCOMM control will drive COM1-4. This is quite simple to do, the following sends the AT command to a modem :-

' Set up the communications port
     MSComm1.CommPort = 1 ' Com Port 1

     ' Set for 9600 baud, no parity, 8 data, and 1 stop bit.
     MSComm1.Settings = "9600,N,8,1"

     ' Tell the control to read entire buffer when Input is used
     MSComm1.InputLen = 0

     ' Open the port
     MSComm1.PortOpen = True

     ' Send an 'AT' command to the phone
     MSComm1.Output = "AT" & Chr$(13) & Chr(10)

Futher info about the control can be found at msdn. Now what's this with the router and WinSock?


Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MAC Filtering: MAC filtering is like handing a list of names to a doorman. If someone comes to the door and mentions a name, this name is checked by the doorman on his list and granted or denied access by this. This means that if someone menti…
Using in-flight Wi-Fi when you travel? Business travelers beware! In-flight Wi-Fi networks could rip the door right off your digital privacy portal. That’s no joke either, as it might also provide a convenient entrance for bad threat actors.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question