Solved

Delphi compressbuf

Posted on 2011-02-14
6
1,419 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

19 Experts available now in Live!

Get 1:1 Help Now