Solved

Delphi compressbuf

Posted on 2011-02-14
6
1,429 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:l3m0n
  • 4
6 Comments
 

Author Comment

by:l3m0n
ID: 34892529
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)
0
 
LVL 24

Expert Comment

by:jimyX
ID: 34894372
This error occurs when the host is unknown. Check the host name, it seems you used a wrong host name.
0
 
LVL 19

Expert Comment

by:Thommy
ID: 34894451
Delphi Troubleshooting
Undeclared identifier: 'XXXX'
http://www.cryer.co.uk/brian/delphi/error_undeclared_identifier.htm
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:Thommy
ID: 34894476
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!

0
 
LVL 19

Expert Comment

by:Thommy
ID: 34894725
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.
0
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 34894753
Already asked before in EE..

Winsock error 11004 how to solve it ?
http://www.experts-exchange.com/Programming/System/Windows__Programming/MFC/Q_20298382.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now