This article uses Visual C++2015 software as an example to write a program similar to QQ chat tool. Based on the basic windows programming development knowledge, windows graphics window programming, network programming principles and implementation methods based on TCP/IP protocol, the use of multi-threaded programming, combined with the previous examples for you to explain how a win window application should be written, What are the precautions?
The development of the QQ chat tool program, the original quote is as follows:
The following is a comprehensive example: chat program. This is a chat program similar to QQ. For the sake of simplicity, the server-side program and the client-side program are combined. This program is both a server program and a client program.
First create a project, click on the menu "New Project", as shown below:
Set the project type to "Windows Forms Application" and set the project name to "ChatDemo" as shown below:
Once the project is built, first add a TextBox control to the form. Click the "TextBox" control in the toolbox, as shown below:
Drag and drop a TextBox in the form, and all the chat content will be displayed in this window. Set its name to "ShowBox" and set its "MulTIline" property to "True" and set its "Scrollbar" property to "VerTIcal" (vertical scroll bar), as shown below:
Set the title of the form to "Chat" and add a TextBox named "InputBox" under "ShowBox". You can enter what you want to say in this input box. Also add a "send" button to send what you want to say, name the button "SendTextButton", as shown below:
Set the "TabIndex" property of the control that displays the chat content to "2", so that the focus of the program input will be located in the input box below, as shown below:
The interface of the program is complete.
The following is a screenshot of the actual running of the program, the following figure is the server-side program:
Want to see more about the VC2005 chat tool program implementation content, click this link to download the original reading (click on the title): VC2005 tutorial
Jinhu Weibao Trading Co., Ltd , https://www.weibaoe-cigarette.com