I have about 8 lines of code that access the 32 bit cards.dll file (the same one that runs solitare etc.). I declare my API functions and have a single button that then calls a function to display one of the cards in the dll on a form. Everything runs fine in debug mode. Card appears perfectly and everything is grand. When I make the .exe and attempt to run it outside of the debugger I get an illegal operation error on my pc. I have also tried it on an NT workstation pc and same thing. Works fine in debug mode but gets a application error in the .exe.
I guess my question is... Whats different in debug mode that allows the program to execute. How can I get the same results in the compiled .exe. Needless to say this is the first time I have run across such a problem.
here is my code
Something else wierd is that the error handling never gets called. It just goes right to the application error and kills the app.Code:' cards.dll access module Public Declare Function cdtInit Lib "cards.DLL" _ (ByRef nWidth As Integer, ByRef nHeight As Integer) As Integer Public Declare Function cdtDraw Lib "cards.DLL" _ (ByVal hDC As Long, ByVal xOrg As Integer, _ ByVal yOrg As Integer, ByVal nCard As Integer, _ ByVal nDraw As Integer, ByVal nColor As Integer) As Integer Public Declare Function cdtTerm Lib "cards.DLL" () As Integer Public nWide As Integer Public nTall As Integer 'Use in the nDraw field Global Const cdFACE = 0 Global Const cdBACK = 1 Global Const cdINVERT = 2 'Card Backs 'Use in the nCard field 'REMINDER: when nCard > 53 then nDraw must be = 1 (C_BACKS) Global Const bkCrosshatch = 53 Global Const bkWeave1 = 54 Global Const bkWeave2 = 55 Global Const bkRobot = 56 Global Const bkFlowers = 57 Global Const bkVine1 = 58 Global Const bkVine2 = 59 Global Const bkFish1 = 60 Global Const bkFish2 = 61 Global Const bkShells = 62 Global Const bkCastle = 63 Global Const bkIsland = 64 Global Const bkCardhand = 65 Global Const UNUSED = 66 Global Const THE_X = 67 Global Const THE_O = 68 'form code Private Sub Command1_Click() On Error GoTo ErrHand Call cdtInit(nWide, nTall) Randomize Call cdtDraw(Form1.hDC, 30, 20, Int((51 * Rnd) + 0), cdFACE, 1) Exit Sub ErrHand: MsgBox ("Could not display card.") End Sub Private Sub Form_Unload(Cancel As Integer) Call cdtTerm End Sub
[Edited by scuzymoto on 05-18-2000 at 09:51 AM]




Reply With Quote