Solved

Using Sockets

Posted on 1998-12-18
2
179 Views
Last Modified: 2013-11-20
I'd like to know how to use, in a MFC program, sockets to send and recieve data. I am working on a client application that will need to connect and send data to various other machines. It really seems simple but I am soooo lost. Everything in the MFC samples on the VC++ 5 cd involves using archives, and the other end will not always be a windows machine. I'm pretty familiar with MFC programming, so I would just need an example of how to declare the Socket and send and how to hook the listening end up.
0
Comment
Question by:jcorbin
  • 2
2 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1326394
The basics are those:
1. Create a derived class from CSocket or CAsyncSocket
2. For a client side, use Connect to connect to the host
3. Use Send to send data
4. In the OnReceive handler, use Receive to receive the data.

If you need any more help, just ask.
0
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
ID: 1326395
The basics are those:
1. Create a derived class from CSocket or CAsyncSocket
2. For a client side, use Connect to connect to the host
3. Use Send to send data
4. In the OnReceive handler, use Receive to receive the data.

If you need any more help, just ask.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 32
sumNumber challenge 16 111
Modbus - whats the maximum I can store in one register? 4 78
sumHeights  challenge 17 66
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

861 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now