Solved

Card games 3

Posted on 1997-05-11
2
198 Views
Last Modified: 2006-11-17
This question is for TWARD.  I had asked about displaying cards using a DLL, cards32.dll from microsoft.  I was wondering where I can find this DLL, as my system directory only has card.dll.

Thanks.
Dan Bajwa
0
Comment
Question by:dbajwa
2 Comments
 
LVL 7

Accepted Solution

by:
tward earned 10 total points
ID: 1426205
I am not sure where to get it as the code that I passed on to you I found in one of the Visual Basic NewsGroups.  Below are is the same declares but they are for CARDS.DLL.  I believe the one I send you for CARDS32.DLL has both 32bit and 16bit declares if you look at the end of that file.


''*-----------------------------------------------------------------------------
'|    CARDS.BAS
'|
'|    VB Declares for CARDS.DLL file
'|
'|  Copyright(c) 1996 Microsoft Corporation
'-----------------------------------------------------------------------------*'

Public RA As Integer '     '* Rank *'
Public SU As Integer '     '* Suit *'
Public cd As Integer '     '* Card *'

''*-----------------------------------------------------------------------------
'| cdtDraw and cdtDrawExt mode flags
'-----------------------------------------------------------------------------*'

Const mdFaceUp = 0           '* Draw card face up, card to draw specified by cd *'
Const mdFaceDown = 1         '* Draw card face down, back specified by cd (cdFaceDownFirst..cdFaceDownLast) *'
Const mdHilite = 2           '* Same as FaceUp except drawn with NOTSRCCOPY mode *'
Const mdGhost = 3            '* Draw a ghost card -- for ace piles *'
Const mdRemove = 4           '* draw background specified by rgbBgnd *'
Const mdInvisibleGhost = 5   '* ? *'
Const mdDeckX = 6            '* Draw X *'
Const mdDeckO = 7            '* Draw O *'

''*-----------------------------------------------------------------------------
'| Suit and card indices.  Orders of BOTH are important
'-----------------------------------------------------------------------------*'

Const suClub = 0
Const suDiamond = 1
Const suHeart = 2
Const suSpade = 3
Const suMax = 4
Const suFirst = suClub
Const raAce = 0
Const raTwo = 1
Const raThree = 2
Const raFour = 3
Const raFive = 4
Const raSix = 5
Const raSeven = 6
Const raEight = 7
Const raNine = 8
Const raTen = 9
Const raJack = 10
Const raQueen = 11
Const raKing = 12
Const raMax = 13
Const raNil = 15
Const raFirst = raAce

Const cdAClubs = 0
Const cd2Clubs = 4
Const cd3Clubs = 8
Const cd4Clubs = 12
Const cd5Clubs = 16
Const cd6Clubs = 20
Const cd7Clubs = 24
Const cd8Clubs = 28
Const cd9Clubs = 32
Const cdTClubs = 36
Const cdJClubs = 40
Const cdQClubs = 44
Const cdKClubs = 48
Const cdADiamonds = 1
Const cd2Diamonds = 5
Const cd3Diamonds = 9
Const cd4Diamonds = 13
Const cd5Diamonds = 17
Const cd6Diamonds = 21
Const cd7Diamonds = 25
Const cd8Diamonds = 29
Const cd9Diamonds = 33
Const cdTDiamonds = 37
Const cdJDiamonds = 41
Const cdQDiamonds = 45
Const cdKDiamonds = 49
Const cdAHearts = 2
Const cd2Hearts = 6
Const cd3Hearts = 10
Const cd4Hearts = 14
Const cd5Hearts = 18
Const cd6Hearts = 22
Const cd7Hearts = 26
Const cd8Hearts = 30
Const cd9Hearts = 34
Const cdTHearts = 38
Const cdJHearts = 42
Const cdQHearts = 46
Const cdKHearts = 50
Const cdASpades = 3
Const cd2Spades = 7
Const cd3Spades = 11
Const cd4Spades = 15
Const cd5Spades = 19
Const cd6Spades = 23
Const cd7Spades = 27
Const cd8Spades = 31
Const cd9Spades = 35
Const cdTSpades = 39
Const cdJSpades = 43
Const cdQSpades = 47
Const cdKSpades = 51
Const cdFaceDownFirst = 54
Const cdFaceDownLast = 65

'/*-----------------------------------------------------------------------------
'| Face down cds
'-----------------------------------------------------------------------------*/

Const cdFaceDown1 = 54
Const cdFaceDown2 = 55
Const cdFaceDown3 = 56
Const cdFaceDown4 = 57
Const cdFaceDown5 = 58
Const cdFaceDown6 = 59
Const cdFaceDown7 = 60
Const cdFaceDown8 = 61
Const cdFaceDown9 = 62
Const cdFaceDown10 = 63
Const cdFaceDown11 = 64
Const cdFaceDown12 = 65
'Const cdFaceDownFirst = cdFaceDown1
'Const cdFaceDownLast = cdFaceDown12

'/*-----------------------------------------------------------------------------
'|    cdtInit
'|
'|        Initialize cards.dll -- called once at app boot time.
'|
'|    Arguments:
'|        int FAR *pdxCard: returns card width
'|        int FAR *pdyCard: returns card height
'|
'|    Returns:
'|        TRUE if successful.
'-------------------------------------------------------------------------------*/
'BOOL _declspec(dllexport) cdtInit(int FAR *pdxCard, int FAR *pdyCard);

Declare Function cdtInit Lib "cards.dll" (pdxCard As Integer, pdyCard As Integer) As Integer

'/*-----------------------------------------------------------------------------
'|    cdtDraw
'|
'|        Draw a card
'|
'|    Arguments:
'|        HDC hdc
'|        int x: upper left corner of the card
'|        int y: upper left corner of the card
'|        int cd: card to draw (depends on md)
'|        int md: mode
'|           mdFaceUp:    draw face up card (cd in cdAClubs..cdKSpades)
'|           mdFaceDown:  draw face down card (cd in cdFaceDown1..cdFaceDown12)
'|           mdHilite:    draw face up card inversely
'|           mdGhost:     draw a ghost card, cd ignored
'|           mdRemove:    draw rectangle of background color at x,y
'|           mdDeckX:     draw an X
'|           mdDeckO:     draw an O
'|        DWORD rgbBgnd: table background color (only required for mdGhost and mdRemove)
'|
'|    Returns:
'|        TRUE if successful
'-----------------------------------------------------------------------------*/
'BOOL _declspec(dllexport) cdtDraw(HDC hdc, int x, int y, int cd, int md, DWORD rgbBgnd);

 Declare Function cdtDraw Lib "cards.dll" (hdc As Long, x As Integer, y As Integer, cd As Integer, md As Integer, rgbBgnd As Long) As Integer

'/*-----------------------------------------------------------------------------
'|    cdtDrawExt
'|
'|        Same as cdtDraw except will stretch the cards to an arbitray extent
'|
'|    Arguments:
'|        HDC hdc
'|        int x
'|        int y
'|        int dx
'|        int dy
'|        int cd
'|        int md
'|        DWORD rgbBgnd:
'|
'|    Returns:
'|        TRUE if successful
'-----------------------------------------------------------------------------*/
'BOOL _declspec(dllexport) cdtDrawExt(HDC hdc, int x, int y, int dx, int dy, int cd, int md, DWORD rgbBgnd);

Declare Function cdtDrawExt Lib "cards.dll" (hdc As Integer, x As Integer, y As Integer, dx As Integer, dy As Integer, dy As Integer, cd As Integer, md As Integer) As Integer
 
 '/*-----------------------------------------------------------------------------
'|    cdtAnimate
'|
'|        Draws the animation on a card.  Four cards support animation:
'|
'|      cd         #frames    description
'|   cdFaceDown3   4          robot meters
'|   cdFaceDown10  2          bats flapping
'|   cdFaceDown11  4          sun sticks tongue out
'|   cdFaceDown12  4          cards running up and down sleave
'|
'|    Call cdtAnimate every 250 ms for proper animation speed.
'|
'|    Arguments:
'|        HDC hdc
'|        int cd    cdFaceDown3, cdFaceDown10, cdFaceDown11 or cdFaceDown12
'|        int x:    upper left corner of card
'|        int y
'|        int ispr  sprite to draw (0..1 for cdFaceDown10, 0..3 for others)
'|
'|    Returns:
'|       TRUE if successful
'-----------------------------------------------------------------------------*/
'BOOL _declspec(dllexport) cdtAnimate(HDC hdc, int cd, int x, int y, int ispr);

Declare Function cdtAnimate Lib "cards.dll" (hdc As Integer, cd As Integer, x As Integer, y As Integer, ispr As Integer) As Integer

'/*-----------------------------------------------------------------------------
'|    cdtTerm
'|
'|        Call once at app termination
'-----------------------------------------------------------------------------*/
'VOID _declspec(dllexport) cdtTerm(VOID);

Declare Sub cdtTerm Lib "cards.dll" ()

0
 

Author Comment

by:dbajwa
ID: 1426206
Adjusted points to 10
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question