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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Coaxial cable bending There are several factors that govern the selection of coaxial cable for your Machine to Machine (M2M) application: the location of cable runs, either indoor or outdoor, inside or outside an enclosure, maximum bending and the…
This program is used to assist in finding and resolving common problems with wireless connections.
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…

800 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