BigSpeed ZIP
Verfasst: So, 05. Jun 2011 15:42
Hallo,
hat eventuell jemand dafür einen Wrapper ?
hat eventuell jemand dafür einen Wrapper ?
Das deutschsprachige Forum für Entwickler in der Xbase-Welt, ein Angebot des Deutschsprachige Xbase-Entwickler e. V.
https://www.xbaseforum.de/
das "Problem" kann man mit der Option "-es" umgehen und es geht deutlich schneller ...Koverhage hat geschrieben:2. Speicherbedarf, gerade z.B. für Datensicherungen, daran ist (glaube ich) auch AddZip gescheitert.
das ist doch einer der Optionen die es gibt.Koverhage hat geschrieben:was bedeutet -es ?
-e[x,n,f,s,0] use [eXtra|Normal (default)|Fast|Super fast|NO compression]
Code: Alles auswählen
// ---------------------------------------------------------------------------------
// int zCompressFiles(cTempDir, cPassword, nMode, lResetArchivAttribute, nSpanSize, cComment, RTInfoFunc)
// Call this function to actually compress the files, previously
// requested with zOrderFile/ZOrderByWildCards. Parameters are:
//
// cTempDir - the temporary directory to be used. If it is empty, the
// default Windows temporyry directory will be used
//
// cPassword - if is not empty, the files will be encrypted with this password.
//
// nMode - CompressionMethod - there 4 possible values
// 0 : Stored, no compression
// 1 : Fast Compression
// 2 : Normal compression
// 3 : Max compression
//
// lResetArchivAttribute - if it is true, the Archiv attribute of the
// file will be reset after compressing of the file.
//
// nSpanSize - There are 3 cases here:
// < 0 : Disabled - spanning is not allowed
// = 0 : Automatic - automatically prompt for another diskette when
// the current one is full. Applicable only for
// removable drives.
// > 0 : Custom - multi-volume zip archive will be created and this
// value will be the maximum size of each volume.
// Applicable only for non-removable drives.
//
// cComment - if is not empty, will be stored as a comment in the zip file.
//
// RTInfoFunc - pointer to the application function, which will be called
// periodically (after 1 sec) from the library to show runtime
// information, for example some kind of progress bar. Within this
// function, application can call bs_GetRunTimeInfo or
// bs_CancelOperation. If Nil, no runtime information will be
// available.
//
// Returns zero on success, otherwise application can call bs_GetLastErrorAsText
// to get the type of error.
// ---------------------------------------------------------------------------------
function bs_CompressFiles(cTempDir, cPassword, nMode, lResetArchivAttribute, nSpanSize, cComment, RTInfoFunc)
LOCAL nResult := 0
LOCAL oScrn
Local reqbytes := Unsigned32(bs_getOrderedBytes()) // total size of files requested for compression, unsigned32 function in ot4xb
Local reqFiles := bs_getOrderedFiles() // number of files requested for compression
DEFAULT cTempDir TO " "
DEFAULT nMode TO 2
DEFAULT lResetArchivAttribute TO 0
DEFAULT nSpanSize TO 0
oScrn := XbpStatic():new(oCrt:DrawingArea,, { 0, 40}, { oCrt:currentSize()[1]-2,20},, .T.)
oScrn:type := XBPSTATIC_TYPE_TEXT
oScrn:caption := " % gezipped"
oScrn:options := XBPSTATIC_TEXT_CENTER + XBPSTATIC_TEXT_VCENTER
oScrn:create()
oScrn:setColorBG(XBPSYSCLR_DIALOGBACKGROUND)
oScrn:setColorFg(GRA_CLR_BLACK)
oScrn:setFontCompoundName( "8.Arial" )
oScrn:show()
nResult := DllCall(nBsDll,DLL_STDCALL,"zCompressFiles",cTempDir, cPassword, nMode, lResetArchivAttribute, nSpanSize, cComment, ShowRTInfo(oScrn, reqBytes, reqFiles))
if nResult # 0
ShowBsError("zCompressFiles",nResult)
endif
oScrn:destroy()
return nResult
function bs_GetRunTimeInfo(nProcessedFiles, nProcessedBytes)
local nResult := DllCall(nBsDll,DLL_STDCALL,"zGetRunTimeInfo",@nProcessedFiles, @nProcessedBytes )
return iif(nResult>0,.t.,.f.)
static function ShowRTInfo(oStatusWindow, reqBytes, reqFiles)
Local ii := 0
Local pf := 0 // number of currently processed files
Local pb := 0 // number of currently processed bytes
bs_GetRuntimeInfo(@pf,@pb)
if reqBytes > 0
ii := round(pb / (reqBytes / 100),0)
oStatusWindow:setCaption( str(ii)+" % gezipped" )
endif
// Original delphi code
//var
// ii, pf, pb : integer;
//begin
// zGetRunTimeInfo(pf,pb);
// if reqbytes > 0 then
// ii := round(pb / reqbytes * 100)
// else
// ii := 0;
// with fPgsInd do
// begin
// stprocfiles.Caption := RightStr(pf);
// stprocbytes.Caption := RightStr(pb);
// PgsBar.Position := ii;
// Update;
// end;
// Application.ProcessMessages;
return NIL
du rufst die Function ja auch "nur" einmal auf ...Koverhage hat geschrieben:Ich möchte eine Progressbar oder Text anzeigen, damit man sieht
das was passiert.
Ich kann einen pointer der Funktion angeben, die z.B. die Anzeige macht.
Wie muss ich das angeben, bei mir funktioniert das nicht
Die Funktion ShowRTInfo wird zwar aufgerufen, aber nur einmal.
Code: Alles auswählen
BEGIN CALLBACK MyEnumWndProc AS BOOL
PARAM HANDLE // hWnd
PARAM DWORD // dwCargo
END CALLBACK