by AngelSalom » Sun May 21, 2006 4:24 pm
He encontrado una dll zip32.dll que trae ejemplos en visual basic.
Lo cierto es que es la primera vez que intento esto, por lo tanto estoy muy "pardillo" en el tema, pero bueno.
Esto es lo que he hecho :
------ Este es el código en vb -------
Public Type ZIPUSERFUNCTIONS
DLLPrnt As Long
DLLPassword As Long
DLLComment As Long
DLLService As Long
End Type
Public Type ZPOPT
fSuffix As Long
fEncrypt As Long
fSystem As Long
fVolume As Long
fExtra As Long
fNoDirEntries As Long
fExcludeDate As Long
fIncludeDate As Long
fVerbose As Long
fQuiet As Long
fCRLF_LF As Long
fLF_CRLF As Long
fJunkDir As Long
fRecurse As Long
fGrow As Long
fForce As Long
fMove As Long
fDeleteEntries As Long
fUpdate As Long
fFreshen As Long
fJunkSFX As Long
fLatestTime As Long
fComment As Long
fOffsets As Long
fPrivilege As Long
fEncryption As Long
fRepair As Long
flevel As Byte
date As String
szRootDir As String
End Type
Public Type ZIPnames
s(0 To 99) As String
End Type
Public Declare Function ZpInit Lib "zip32.dll" (ByRef Zipfun As ZIPUSERFUNCTIONS) As Long
Public Declare Function ZpSetOptions Lib "zip32.dll" (ByRef Opts As ZPOPT) As Long
Public Declare Function ZpArchive Lib "zip32.dll" (ByVal argc As Long, ByVal funame As String, ByRef argv As ZIPnames) As Long
------------------------------------------------------------------------
--- Este es mi "intento" de traducirlo -------------
/* -----------------------------------------------------------------------------------
Pruebas con archivos ZIP
-----------------------------------------------------------------------------------
*/
#include "fivewin.ch"
#include "struct.ch"
Function Main()
Private oZipUserFunctions, ozPopt, oZipNames, oZipFun, oOpts, nArgC, cFuName, oArgV
STRUCT oZipUserFunctions
MEMBER DLLPrnt As DWORD
MEMBER DLLPassword As DWORD
MEMBER DLLComment As DWORD
MEMBER DLLService As DWORD
ENDSTRUCT
STRUCT oZpopt
MEMBER fSuffix As DWORD
MEMBER fEncrypt As DWORD
MEMBER fSystem As DWORD
MEMBER fVolume As DWORD
MEMBER fExtra As DWORD
MEMBER fNoDirEntries As DWORD
MEMBER fExcludeDate As DWORD
MEMBER fIncludeDate As DWORD
MEMBER fVerbose As DWORD
MEMBER fQuiet As DWORD
MEMBER fCRLF_LF As DWORD
MEMBER fLF_CRLF As DWORD
MEMBER fJunkDir As DWORD
MEMBER fRecurse As DWORD
MEMBER fGrow As DWORD
MEMBER fForce As DWORD
MEMBER fMove As DWORD
MEMBER fDeleteEntries As DWORD
MEMBER fUpdate As DWORD
MEMBER fFreshen As DWORD
MEMBER fJunkSFX As DWORD
MEMBER fLatestTime As DWORD
MEMBER fComment As DWORD
MEMBER fOffsets As DWORD
MEMBER fPrivilege As DWORD
MEMBER fEncryption As DWORD
MEMBER fRepair As DWORD
MEMBER flevel As DWORD
MEMBER date As STRING LEN 10
MEMBER szRootDir As STRING LEN 100
ENDSTRUCT
STRUCT oZipNames
MEMBER S As STRING
ENDSTRUCT
msginfo (ZpInit())
msginfo (ZpSetOptions())
msginfo (ZpArchive(1,"test.zip",{"test.obj"}))
Return (nil)
// Declaración de DLL32
DLL32 Function ZpInit (@oZipFun AS oZipUserFunctions) As DWORD PASCAL LIB "zip32.dll"
DLL32 Function ZpSetOptions (@oOpts AS oZpOpt) As DWORD PASCAL LIB "zip32.dll"
DLL32 Function ZpArchive (@nArgc AS DWORD,;
@cFuName AS STRING,;
@oArgV AS oZipNames) As DWORD PASCAL LIB "zip32.dll"
--------------------------------------------------------
bueno, tras esto la funcion zpinit y la funcion zpsetoptions se ejecutan sin problemas pero la zparchive me da un error harbour exception error, y supongo que habre definido mal alguno de los parámetros, pero ya os digo que ando muy verde ....
Alguien con experiencia puede hecharme una mano???
Gracias.
Angel Salom
Visionwin Software -
https://www.visionwin.com------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4