dplambert
asked on
Declare Function can't find DLL
I'm working on a card game for fun and I'm using Microsoft's cards.dll for graphics. On the development machine, the VB app can find the DLL which is present in c:\WINNT\system32\cards.dl l. On a test machine, the DLL is not found but it's present in c:\Windows\System\cards.dl l.
Here's some code that hits the DLL:
----
Private Declare Function cdtInit Lib "cards" ( _
lngDeckWidth As Long, _
lngDeckHeight As Long _
) As Long
----
I would assume that VB looks first in the computer's system folder for any file named "cards" with a DLL extension. This folder could be different between machines.
What's the problem?
Here's some code that hits the DLL:
----
Private Declare Function cdtInit Lib "cards" ( _
lngDeckWidth As Long, _
lngDeckHeight As Long _
) As Long
----
I would assume that VB looks first in the computer's system folder for any file named "cards" with a DLL extension. This folder could be different between machines.
What's the problem?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Makes sense since the cards.dll is in the system directory instead of the system32 :-)
CJ
CJ
ASKER
Are you saying that a 16-bit DLL can't be used by VB 6.0?
Yes, a 16 bit DLL cannot be called from 32 bit VB code. You have to use the 32 bit DLL. Renaming it prevents it from screwing up Win9x card games (overwriting cards.dll) when installed on a Win9x system.
ASKER
You hit it on the head! Thanks a lot.
ASKER
I'd like to note that if placed in the same folder as the .exe, it can't find Cards32.dll. I have to put it in the system folder.
CJ