CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - thread VC
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - thread VC - List
[
Chess Poker games
]
five
DL : 0
我使用以前的五子棋VC游戏的架构和资源,用了一个副线程将我的通讯与框架代码写在里面,MFC与副线程间是用内核对象和全局变量通讯的。 1.主线程: a负责创建MFC单文档 b,等待副线程开启鼠标移动和左击事件的许可,是bool g_mouseMoveAble和bool g_lButtonDownAble两个变量来控制的。 c,单击事件发生后,如果单击的合法(在棋盘上不与其它的棋子冲突),就可以将通知(HANDLE hEvent)给副线程,通知它来处理。 2.副线程 a.连接服务器(TCP) b.等待一秒(等待MFC的类创建完)。 c.然后就开始与服务器通讯。 使用方法: 1,编译运行"网络五子棋\一主多从winsock_dos\TCPServer_winsock” 2,编译运行"网络五子棋\游戏91023A" 3,编译运行"网络五子棋\游戏91023B" 一定要按顺序来呀。代码写的很粗糙,没有时间和能力将它写好,但是还是可以懂得吧。 -I use the previous game Renju VC structure and resources are used, a Vice-thread communication and the framework of my code is written on the inside, MFC and sub-threads is to use kernel objects and global variables of communication.
Date
: 2026-01-01
Size
: 4.78mb
User
:
sunyi
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.