Click here to Skip to main content
13,297,321 members (67,912 online)
Click here to Skip to main content
Add your own
alternative version


19 bookmarked
Posted 12 Aug 2004

WTL SeaBattle game

, 12 Aug 2004
Rate this:
Please Sign up or sign in to vote.
SeaBattle game written using WTL


WTL is relatively unknown library for most of C++ developers. Even in its current state (with no official Microsoft support as far as I know) it could compete with MFC as tool for development GUI applications a especially small standalone applications. It is template library and if you design your application right, then it would depend on minimal or none other dll. So I decided to write WTL application just for sake of experience to see how hard to do it. It turns out to easy enough for a programmer with experience in MFC and WinAPI. Most of the classes match names of MFC classes serving the same purpose. And I did not have to wonder if I got right version of MFC dlls on any other machine where I copied my application. I wanted to do something which would not be too boring, so it was a logical choice to write something funny and useless: a game. WTLSeaBattle is simple version of widely known game “Sea Battle”, it sole purpose is to give an example of dialog based WTL application.

Building Environment

This application was developed using VC++ 6.0 SP6 and WTL70, and tested under Windows XP.

Application Description

WTLSeaBattle is dialog-based application written using WTL. Its main class is CMainDlg (files maindlg.*) which deals with managing controls in dialog, “battle field” classes and communications between objects inside application. Classes CMyShips (MyShips.cpp) and CEnemyShips (EnemyShips.cpp) implement player’s and computer’s game fields respectively. CMyShips and CEnemyShips derived from common base class CDisplayAreaWnd which contains common functionality. CMyShips allows user to place ships, CEnemyShips places computer’s ships and handles calculation of next “shot” during game.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Gregory Elbert
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

Generalplz teach mee Pin
Pandeydwr6-Jul-07 3:15
memberPandeydwr6-Jul-07 3:15 
Generalmediocre Pin
Joseph .OM12-Jun-07 1:28
memberJoseph .OM12-Jun-07 1:28 
GeneralAbout an error of the source Game WTL Sea Battle Pin
jedimastervn22-Oct-06 8:47
memberjedimastervn22-Oct-06 8:47 
GeneralRe: About an error of the source Game WTL Sea Battle Pin
Gregory Elbert23-Oct-06 11:37
memberGregory Elbert23-Oct-06 11:37 
GeneralRe: About an error of the source Game WTL Sea Battle Pin
jedimastervn25-Oct-06 8:48
memberjedimastervn25-Oct-06 8:48 
GeneralRe: About an error of the source Game WTL Sea Battle Pin
Gregory Elbert1-Nov-06 9:28
memberGregory Elbert1-Nov-06 9:28 
GeneralRe: About an error of the source Game WTL Sea Battle Pin
Pandeydwr6-Jul-07 3:14
memberPandeydwr6-Jul-07 3:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 13 Aug 2004
Article Copyright 2004 by Gregory Elbert
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid