Advertisement

07.28.2008 at 02:55PM PDT, ID: 23602328
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

Visual C++ 6.0 / MFC -> problem in listening by winsock

Asked by CSecurity in Windows MFC Programming, Microsoft Visual C++.Net, Microsoft Visual C++

Tags:

Hi
I am developing a simple chat program in Visual C++ 6.0  / MFC. this application has two part: client and server that user can listen or connect to another copy of my program. for connect and send data, fortunately I have no problem but for listening and get incoming data I have problem. I dont know how can I realize that some text sent by another application.
The attached code always wait for incoming data and never can response to another job even moving the form! So I want a code (like event) that I can realize incoming data and attach to end of editbox. I tried to do this by thread, but I with error messages found out that i can not alter form's property by thread!
and I have 3 simple questions too:
1-in my MFC application's form, when I press Esc, application exits. How can I prevent this?
2-I have trouble with member variables of controls on the form (like editbox). I set port_number for editbox1 as int, and in code, always port_number is zero (when i typed in editbox: 4545)
3-how can i do something (like show messagebox) when my application starts (form load)?
sorry for my long question, but if I could do, i would set 1000 points to this question.
thank you very much from now...
Regards...Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
UpdateData(TRUE);
	WSAData wsdata;
	WSAStartup(MAKEWORD(2,0),&wsdata);
	SOCKET sock = socket(AF_INET,SOCK_STREAM,0);
	
	sockaddr_in sin;
	sin.sin_family = AF_INET;
	sin.sin_port=htons(str_port);
	sin.sin_addr.s_addr=INADDR_ANY;
	
	bind(sock,(sockaddr*)&sin,sizeof(sin));
	listen(sock,SOMAXCONN);
	SOCKET client;
	int len=sizeof(sin);
	client = accept(sock,(sockaddr*)&sin,&len);
	while(true)
	{
		recv(sock,buf,sizeof(buf),0);
		if(strlen(buf)!=0)
                str_received.Insert(str_received.GetLength(),buf); 
                //str_received is variable member of editbox
	}
	UpdateData(FALSE);
Attachments:
 
as you see when app starts two editbox's are 0. i wanna change them to default value: 4545
as you see when app starts two editbox's are 0. i wanna change them to default value: 4545
 
[+][-]07.28.2008 at 03:29PM PDT, ID: 22107300

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.28.2008 at 03:56PM PDT, ID: 22107443

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.28.2008 at 04:59PM PDT, ID: 22107749

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows MFC Programming, Microsoft Visual C++.Net, Microsoft Visual C++
Tags: Visual C++ 6.0
Sign Up Now!
Solution Provided By: mitb
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.28.2008 at 05:06PM PDT, ID: 22107778

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.29.2008 at 12:01AM PDT, ID: 22109152

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 01:08AM PDT, ID: 22109458

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 01:59AM PDT, ID: 22109687

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 02:15AM PDT, ID: 22109737

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 02:24AM PDT, ID: 22109762

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 04:39AM PDT, ID: 22110418

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 04:46AM PDT, ID: 22110456

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 05:45AM PDT, ID: 22110842

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 06:32AM PDT, ID: 22111225

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.29.2008 at 04:23PM PDT, ID: 22116566

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.01.2008 at 04:06PM PDT, ID: 22142473

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 02:08PM PDT, ID: 22148850

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628