AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

CompressBuf, DeCompressBuf unter D2010?

Ein Thema von sko1 · begonnen am 2. Okt 2018 · letzter Beitrag vom 2. Okt 2018
 
sko1

Registriert seit: 27. Jan 2017
601 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#1

CompressBuf, DeCompressBuf unter D2010?

  Alt 2. Okt 2018, 12:32
Hallo,

folgendes lässt sich nicht compilieren:

Code:
uses ZLib;

function CompressString(input:string):string;
var
  InpBuf, OutBuf: Pointer;
  OutBytes: Integer;
begin
  InpBuf := nil;
  OutBuf := nil;
  try
    GetMem(InpBuf, Length(input));
    Move(input[1], InpBuf^, Length(input));
    CompressBuf(InpBuf, Length(input), OutBuf, OutBytes);
    SetLength(result,OutBytes);
    Move(OutBuf^, result[1], OutBytes);
  finally
    if InpBuf <> nil then FreeMem(InpBuf);
    if OutBuf <> nil then FreeMem(OutBuf);
  end;
end;

function DeCompressString(input:string):string;
var
  InpBuf, OutBuf: Pointer;
  OutBytes: Integer;
begin
  InpBuf := nil;
  OutBuf := nil;
  try
    GetMem(InpBuf, Length(input));
    Move(input[1], InpBuf^, Length(input));
    DeCompressBuf(InpBuf, Length(input),0,OutBuf, OutBytes);
    SetLength(result,OutBytes);
    Move(OutBuf^, result[1], OutBytes);
  finally
    if InpBuf <> nil then FreeMem(InpBuf);
    if OutBuf <> nil then FreeMem(OutBuf);
  end;
end;
beide CompressBuf und DeCompressBuf sind, trotz eingebundener ZLib unbekannt!

Hat jemand einen Tip für mich?

Ciao
Stefan
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:40 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz