Click here to Skip to main content
Click here to Skip to main content

Playing Cards DLL

By , 9 Aug 2003
 

Using cards.dll in an MFC application

 

 

 

 

 

 

 

Introduction

The Cards.dll includes bitmaps of playing cards as resources. It can be useful for developing card games.

Using the code

There was actually no coding involved in producing the DLL, as a matter of fact, it is just a convenient way of storing a large number of bitmaps that could be used in several programs. The code section below is an example of how to load a bitmap from Cards.dll.

//INCLUDE THE CARDS.h FILE FOUND IN THE ZIP CODE TO USE THE DEFINES, 
//OTHERWISE YOU CAN USE THE RESOURCE NUMBERS, AS EXPLAINED IN THE .H 
//FILE

#include "Cards.h"

//LOAD THE DLL

HMODULE <code>hModule</CODE> = LoadLibrary("Path\\To\\Cards.dll"); 

//LOAD THE BITMAP
HBITMAP <CODE>hBitmpap</CODE> = 
        LoadBitmap(<CODE>hModule</CODE>,MAKEINTRESOURCE(IDB_H01))); 
//IDB_H01 IS THE ACE OF HEARTS, WHICH CORRESPONDS TO 4001

//FREE THE DLL
FreeLibrary(<CODE>hModule</CODE>);

//FOR MFC, IT IS RECOMMENDED TO USE 
//AfxLoadLibrary(...) and AfxFreeLibrary (...) <P></P>

History

This is my first update. Suggestions are well accepted!

License

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

eugi
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 1mvpDavidCrow23 Jan '09 - 10:29 

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 10 Aug 2003
Article Copyright 2003 by eugi
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid