Seite 1 von 1

BigSpeed ZIP

Verfasst: So, 05. Jun 2011 15:42
von Koverhage
Hallo,

hat eventuell jemand dafür einen Wrapper ?

Re: BigSpeed ZIP

Verfasst: So, 05. Jun 2011 20:45
von brandelh
Hi,

hast du denn eine Web-Site ?

Re: BigSpeed ZIP

Verfasst: So, 05. Jun 2011 21:34
von georg
Hallo,


vor einigen Jahren habe ich ein GUI-Frontent für WinRAR geschrieben, dass sich der Befehlszeilen-Version von WinRAR bedient und einfach RunShell verwendet.


Gruss,

Georg

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 7:37
von Koverhage
Hallo Hubert,

http://www.bigspeed.net/index.php?page=bszipdll

Normal setze ich ja ADDZIP ein, welches manchmal Probleme macht.
Bei XBZip fehlt die Passwortverschlüsselung.


Habe jetzt gestern mal angefangen, allerdings nicht so schick als Klasse, sondern
auf die "alte" herkömmliche Art.

Soweit denke ich mal alles kein Problem, habe aber noch nichts getestet, etc.

Es gibt speziell eine Frage aber die stelle ich wenn es soweit ist.

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 8:26
von brandelh
Hört sich gut an ;-)

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 9:24
von Koverhage
hat sogar eine inc Datei für power basic ;-)

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 10:16
von brandelh
Ist die INC auch in der Testversion enthalten ?
Wenn ja könntest du mir die mal zumailen ... für die QuickPDF habe ich ein Übersetzungsprogramm von PowerBasic INC nach PRG geschrieben ;-)

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 12:13
von Koverhage
ja ist alles dabei (habe bisher auch nur die Testversion).
Den Wrapper habe ich soweit, allerdings noch nicht getestet. Wenn ich damit
durch bin, stelle ich den hier in die Wissensbasis.

http://www.bigspeed.net/download.php?ur ... zipdll.zip

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 12:55
von brandelh
Hi,

interessant, die Funktion die die ZIP schließt etc. hat keinen Parameter, also immer nur eine ZIP zur gleichen Zeit ?

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 13:12
von Koverhage
Hast Du Fälle in denen Du mehrere Zip Dateien gleichzeitig erstellt ?

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 17:11
von brandelh
Stellst du Fragen ... :shock: ... :?: ...
:idea: Serversoftware könnte das schon, wenn mehrere Threads gleichzeitig laufen ...
Bei meinen CGI EXE sind diese aber auf jeden Fall eigene Prozesse mit eigenem Adressraum ... :D
;-)

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 18:18
von Koverhage
Ich glaube das wird intern geregelt, bin mir aber nicht sicher.
Ich denke schon das jeder Thread sein eigenes Zip File erstellen kann.
Das einzige Problem was ich derzeit habe ist: Ich kann keine Dateien ausschließen.
Ich könnte mir mit Directory ein Array erstellen und alle Dateien die ich ausschließen möchte löschen,
hat aber 2 gravierende Nachteile.
1. macht nicht wirklich Freude, da ich dann das Array durchgehen muss und jede Datei einzeln übergeben
2. Speicherbedarf, gerade z.B. für Datensicherungen, daran ist (glaube ich) auch AddZip gescheitert.

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 18:51
von AUGE_OHR
Koverhage hat geschrieben:2. Speicherbedarf, gerade z.B. für Datensicherungen, daran ist (glaube ich) auch AddZip gescheitert.
das "Problem" kann man mit der Option "-es" umgehen und es geht deutlich schneller ...

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 19:51
von Koverhage
Jimm<,

was bedeutet -es ?

Re: BigSpeed ZIP

Verfasst: Mo, 06. Jun 2011 20:39
von AUGE_OHR
Koverhage hat geschrieben:was bedeutet -es ?
das ist doch einer der Optionen die es gibt.
-e[x,n,f,s,0] use [eXtra|Normal (default)|Fast|Super fast|NO compression]

Re: BigSpeed ZIP

Verfasst: Di, 07. Jun 2011 12:02
von Koverhage
Bin jetzt soweit das ich z.B. alle *.db? zippen kann
und diese dann auch entpacken kann.

Ich habe allerdings zwei Probleme:
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.

hier meine Funktion

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


Hier der Delphi Aufruf
function zCompressFiles(TempDir, Password: pchar; CompressionMethod : integer; ResetArchiveAttribute: boolean; SpanSize: Integer; Comment: String; RTInfoFunc:pointer) : integer; stdcall;
bzw. CPP
int __stdcall zCompressFiles(char *TempDir, char *Password, int CompressionMethod, bool ResetArchiveAttribute, int SpanSize, char *Comment, void (__stdcall *RTInfoFunc)(void));
bzw. VB
Declare Function zCompressFiles Lib "bszip.dll" _
(ByVal TempDir As String, _
ByVal Password As String, _
ByVal CompressionMethod As Long, _
ByVal ResetArchiveAttribute As Byte, _
ByVal SpanSize As Long, _
ByVal Comment As String, _
ByVal RTInfoFunc As Long) As Long

Re: BigSpeed ZIP

Verfasst: Di, 07. Jun 2011 20:39
von AUGE_OHR
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.
du rufst die Function ja auch "nur" einmal auf ... ;)
siehe dir doch mal den Progressbar aus dem "Service Pack 2" an. Du wirst dann erkennen das du zum "bewegen" des Progressbar ihm jeweils einen Event senden musst.
Diesen Event, der auch "intern" gesendet werden kann, musst du nun wieder "auswerten".

das "Problem" ist jedoch das DLL / ActiveX nicht im "Xbase++" Thread sondern im GUI Thread laufen, also brauchst du einen "extra" Callback Slot.

für einen "Pointer" brauchst du eine STRUCTURE wie die

Code: Alles auswählen

BEGIN CALLBACK MyEnumWndProc AS BOOL
   PARAM HANDLE   // hWnd
   PARAM DWORD    // dwCargo
END CALLBACK
welche du mit Pablos XPPCBK als Object erstellen kannst.
in dem Callback Slot wird nun die Aktion ausgelöst die den Progressbar zum "laufen" bringt.