Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Use of Cards.dll in VB.NET

Posted on 2004-04-29
2
Medium Priority
?
1,495 Views
Last Modified: 2007-12-19
hi, i am making a card game in vb.net and need some help getting the cards to display. this is what have gathered so far

    Declare Function cdtInit Lib "Cards.Dll" (ByVal dx As Long, ByVal dy As Long) As Long

    Declare Function cdtDrawExt Lib "Cards.Dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal dx As Long, ByVal dy As Long, ByVal ordCard As Long, ByVal iDraw As Long, ByVal clr As Long) As Long

    Declare Function cdtDraw Lib "Cards.Dll" (ByVal hdc As Object, ByVal X As Long, ByVal Y As Long, ByVal iCard As Long, ByVal iDraw As Long, ByVal clr As Long) As Long

    Declare Function cdtTerm Lib "Cards.Dll" () As Long

after setting up the cards.dll, so to exactly draw the card, i need the following

cdtDraw(me.hdc, 100, 100, 4, 0, 1), the trouble is with the me.hdc part
it works in vb6 but not dot net

i have a picturebox and want to be able to draw the windows cards in it.

any help would be great thanks guys



0
Comment
Question by:SilentAssasin
2 Comments
 
LVL 15

Expert Comment

by:Timbo87
ID: 10956749
0
 
LVL 21

Accepted Solution

by:
tovvenki earned 2000 total points
ID: 10957318
Hi,

If you are working at the Windows API level then you have an hDC but if you are working at the Visual Basic .NET level then you need to be working with an instance of the Graphics class.
A real easy way to get an instance of the Graphics object representing a specific form's drawing surface is from the PaintEventArgs.Graphics property, and an easy way to get an hDC (handle to a device context) is from an instance of the Graphics' object's GetHdc method.

have alook at this url
http://www.codeguru.com/vb/gen/vb_misc/gamesandfun/article.php/c5617/

it have more information that might be useful to you.

Hope that this helps you.

Regards,
Venki

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

916 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