NOTE: Nevermind...apparently it didn't move the cards.dll file when I saved it. Once I moved the cards.dll file into the directory of the project it works fine. So if anyone comes across this issue...that was what happened
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I copied a batch of code to display a deck of cards using the windows file for cards. The code is listed here:
sync on : sync
hwnd as integer
dc as integer
load dll "user32.dll",1
hwnd = call dll (1,"GetActiveWindow")
dc = call dll (1,"GetDC",hwnd)
delete dll 1
load dll "gdi32.dll",2
load dll "cards.dll",1
call dll 1, "cdtInit", "", ""
cardWidth = 75;
cardHeight = 100
x = 0
y = 0
flipback = 0
`make a memblock for each card, to hold the image data
for cardid = 1 to 63
make memblock cardid,((cardwidth*cardheight)*4)+12
write memblock dword cardid,0,cardwidth
write memblock dword cardid,4,cardheight
write memblock dword cardid,8,32
next cardid
FOR CardId=0 to 62
call dll 1,"cdtDrawExt", dc, x, y, cardWidth, cardHeight, CardId, flipback, 0
if flipback = 0 and CardId > 51
flipback = 1
endIf
`get the pixel info and put it in the image memblock
in = 12
for yy = 0 to cardheight-1
for xx = 0 to cardwidth-1
value = call dll(2,"GetPixel",dc,xx,yy)
value = rgb(rgbb(value),rgbg(value),rgbr(value)) : `memblock images need to be bgr not rgb
write memblock dword cardid+1,in,value
inc in,4
next xx
next yy
NEXT CardId
call DLL 1, "cdtTerm"
delete dll 1
delete dll 2
`make images from memblocks and delete memblocks
for cardid = 1 to 63
make image from memblock cardid,cardid
delete memblock cardid
next cardid
`save the images to disk
for cardid = 1 to 63
if file exist(str$(cardid)+".bmp") then delete file str$(cardid)+".bmp"
save image str$(cardid)+".bmp",cardid
next cardid
Now when I copied the code and ran it it runs perfectly fine. So I saved the file but didn't change anything. And now when I run it, it says "dll does not exist at line 16" which is the line:
call dll 1, "cdtInit", "",""
Now I don't understand why it works perfectly fine when I open a blank project and paste the code but when I save it, it doesn't work. What is going on here?
LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003