Link to home
Start Free TrialLog in
Avatar of l3m0n
l3m0n

asked on

Delphi compressbuf

Hi i try to compile one component and i get error:

[DCC Error] EGGFuncts.pas(179): E2003 Undeclared identifier: 'CompressBuf'

(delphi xe)
 what could i do?
please help

code:
function Deflate(s: String): String;
var
  pIn, pOut: Pointer;
  i: Integer;
begin
  pIn := nil;
  pOut := nil;
  try
    GetMem(pIn, Length(s)); // zaalokowanie pamieci o wielkosci s
    Move(s[1], pIn^, Length(s)); // skopiowanie zmiennej s do pamieci
    CompressBuf(pIn, Length(s), pOut, i); // kompresja
    SetLength(Result, i); // ustanowienie dlugosci zmiennej wynikowej
    Move(pOut^, Result[1], i); // skopiowanie danych do wyniku
  finally // zwolnienie pamieci
    if pIn <> nil then FreeMem(pIn, Length(s));
    if pOut <> nil then FreeMem(pOut, i);
  end;
end;

Open in new window

Avatar of l3m0n
l3m0n

ASKER

i changed it for:
ZCompress(pIn, Length(s), pOut, i); // kompresja
and it works but i get next error when i try to log into server:
http://img707.imageshack.us/i/easygg.jpg/

english: requested name is valid but the requested type was not found.( ONApi ASync Lookup)
Avatar of jimyX
This error occurs when the host is unknown. Check the host name, it seems you used a wrong host name.
Delphi Troubleshooting
Undeclared identifier: 'XXXX'
http://www.cryer.co.uk/brian/delphi/error_undeclared_identifier.htm
CompressBuf and DecompressBuf are GONE...

Thread: what happened to CompressBuf and DecompressBuf?
https://forums.embarcadero.com/message.jspa?messageID=205048

Re: what happened to CompressBuf and DecompressBuf?
http://embarcadero.newsgroups.archived.at/public.delphi.rtl/201001/1001253157.html

This is from http://stackoverflow.com/questions/943867/zlib-in-delphi-2009...

CompressBuf and DecompressBuf are GONE.
I also have a project that compiles just fine in D7, but fails to compile in D2010 because it can't find "CompressBuf" or "DecompressBuf".
A search using D7's very pleasant find command locates the routines at c:\Program Files\Borland\Delphi7\Source\Rtl\Common\ZLib.pas
But searching with D2010's (awkward separate) "Find in Files" command fails to locate CompressBuf or DecompressBuf anywhere.
It's very disturbing that upgrading the IDE causes routines used and needed in projects to disappear!

Description of Windows Sockets Error Codes...
http://msdn.microsoft.com/en-us/library/ms740668(v=vs.85).aspx

WSANO_DATA
11004  

Valid name, no data record of requested type.
The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a host name-to-address translation attempt (using gethostbyname or WSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An MX record is returned but no A record—indicating the host itself exists, but is not directly reachable.
ASKER CERTIFIED SOLUTION
Avatar of Thommy
Thommy
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial