CPJNCards v1.01
Welcome to CPJNCards, a simple C++ wrapper for "Cards.dll". This DLL provides
the functionality which the cards games supplied with Windows such as Solitaire
and FreeCell use to draw their playing cards. The API exposed from "Cards.dll" is
semi-documented and was originally described in an MSDN article in 1996 by Dave
Edson. Online examples which show you how to use the DLL from C# are available at
http://www.codeproject.com/csharp/drawcardscp1.asp
and http://www.catch22.net/tuts/cardtut.asp.
This class provides a very simply C++ wrapping of the API to get you started writing
your Playing cards game in your C++/ MFC apps.
Copyright
- You are allowed to include the source code in any product (commercial, shareware,
freeware or otherwise) when your product is released in binary form.
- You are allowed to modify the source code in any way you want except you
cannot modify the copyright details at the top of each module.
- If you want to distribute source code with your application, then you are
only allowed to distribute versions released by the author. This is to maintain
a single distribution point for the source code.
Features
- Simple and clean C++ interface.
- The code looks after all the details of loading and obtaining the function
pointers and exposes a simple set of functions via the class. Internally the
class loads the DLL and uses GetProcAddress calls.
Usage
- To use the class in your code simply include PJNCards.cpp in your project
and #include PJNCards.h in which ever of your modules needs to make calls to
the classes.
- Enums are provided to specify the Suits, Background and Rank/Faces to draw.
- To see the class in action, have a look at the code in CTestCardsDlg::OnPaint
in TestCardsDlg.cpp.
History
V1.0 (12 March 2006)
V1.01 (22 December 2006)
- Minor updates to the sample app to allow it to compile cleanly on VC 2005
- Code now uses newer C++ style casts instead of C style casts.
Contacting the Author
PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
22 December 2006