Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP goes poof upon CLEAR DLLS
Message
De
06/06/2003 07:54:15
Geert Van Snik
Zorgned Automatisering Bv
Wageningen, Pays-Bas
 
 
À
04/06/2003 22:36:00
Neil Mc Donald
Cencom Systems P/L
The Sun, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00796026
Message ID:
00797130
Vues:
47
I think I figured out how to work ObjRef, but it reports no 'dangling' objects.
I've shifted my attention to another DLL which should be in the app as well. After writing a small app to see how it's used, I got the same trouble as before. VFP7 crashed AFTER I clear the dll, stranger yet I'm allowed to use any (I didn't test them all) of the Win32 DLL and get to do a CLEAR DLLS without problems.

For this test everything is kept inside a Form no further initialisation seems necessary, for it works upto the point where I try to clear the DLL
Here's the code, please tell me if you see 'strange' code:

frmZipLib.Init()
DECLARE INTEGER Archive_Create IN ZipLib.DLL
DECLARE INTEGER Archive_Destroy IN ZipLib.DLL INTEGER ArcHandle
DECLARE INTEGER Archive_Open IN ZipLib.DLL INTEGER ArcHandle, STRING FileName
DECLARE INTEGER Archive_New IN ZipLib.DLL INTEGER ArcHandle, STRING FileName
DECLARE INTEGER Archive_SetOptions IN ZipLib.DLL INTEGER ArcHandle, LONG Options
DECLARE INTEGER Archive_AddFile IN ZipLib.DLL INTEGER ArcHandle, STRING FileName
DECLARE INTEGER Archive_AddFilesByWildCard IN ZipLib.DLL INTEGER ArcHandle, STRING WildCard
DECLARE INTEGER Archive_ExtractFile IN ZipLib.DLL INTEGER ArcHandle, STRING OutputDirectory
DECLARE INTEGER Archive_ExtractAll IN ZipLib.DLL INTEGER ArcHandle, STRING OutputDirectory
DECLARE INTEGER Archive_FileCount IN ZipLib.DLL INTEGER ArcHandle, INTEGER varCount
DECLARE INTEGER Archive_QueryFile IN ZipLib.DLL INTEGER ArcHandle, INTEGER FileIndex, STRING FileName
DECLARE INTEGER Archive_GetLastError IN ZipLib.DLL
DECLARE INTEGER Archive_GetLastErrorMsg IN ZipLib.DLL STRING Error

frmZipLib.Destroy()
CLEAR DLLS

Controls on the form are two buttons (Zip and unzip button), here's the code:
cmdZipIt.Click()
LOCAL lnArcHandle, lcResult

lnArcHandle = Archive_Create()
IF lnArcHandle = 0
MESSAGEBOX("Couldn't create archive", 16, "Fout!!")
ELSE
Archive_SetOptions(lnArcHandle, 1 + 2 + 4 + 32)
IF Archive_GetLastError() <> 0
lcResult = SPACE(255)
Archive_GetLastErrorMsg(@lcResult)
MESSAGEBOX(lcResult, 64, "Fout")
ENDIF
Archive_New(lnArcHandle, "C:\ZO_Tiel\ZipLib.z")
IF Archive_GetLastError() <> 0
lcResult = SPACE(255)
Archive_GetLastErrorMsg(@lcResult)
MESSAGEBOX(lcResult, 64, "Fout")
ENDIF
Archive_AddFilesByWildCard(lnArcHandle, "C:\ZO_Tiel\*.exe")
IF Archive_GetLastError() <> 0
lcResult = SPACE(255)
Archive_GetLastErrorMsg(@lcResult)
MESSAGEBOX(lcResult, 64, "Fout")
ENDIF
Archive_Destroy(lnArcHandle)
IF Archive_GetLastError() <> 0
lcResult = SPACE(255)
Archive_GetLastErrorMsg(@lcResult)
MESSAGEBOX(lcResult, 64, "Fout")
ENDIF
ENDIF

cmdUnZip.Click()
LOCAL lnArcHandle, lcResult

lnArcHandle = Archive_Create()
IF lnArcHandle = 0
MESSAGEBOX("Couldn't create archive", 16, "Fout!!")
ELSE
Archive_SetOptions(lnArcHandle, 1 + 2 + 4 + 32)
IF Archive_GetLastError() <> 0
lcResult = SPACE(255)
Archive_GetLastErrorMsg(@lcResult)
MESSAGEBOX(lcResult, 64, "Fout")
ENDIF
Archive_Open(lnArcHandle, "C:\ZO_Tiel\ZipLib.z")
IF Archive_GetLastError() <> 0
lcResult = SPACE(255)
Archive_GetLastErrorMsg(@lcResult)
MESSAGEBOX(lcResult, 64, "Fout")
ENDIF
Archive_ExtractAll(lnArcHandle, "C:\Test")
IF Archive_GetLastError() <> 0
lcResult = SPACE(255)
Archive_GetLastErrorMsg(@lcResult)
MESSAGEBOX(lcResult, 64, "Fout")
ENDIF
Archive_Destroy(lnArcHandle)
IF Archive_GetLastError() <> 0
lcResult = SPACE(255)
Archive_GetLastErrorMsg(@lcResult)
MESSAGEBOX(lcResult, 64, "Fout")
ENDIF
ENDIF

Again it all works well until either:
1. I do a CLEAR DLLS then VFP crashes with c0000005
2. I close VFP without ever calling CLEAR DLLS then VFP crashes with c0000005

Can I rule out the possiblity of two faulty DDLs, or am I that unlucky?
To be honest, I'm out of ammo on this...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform