Делал по примеру, как в исходнике:
Код:
procedure TForm1.ICQClientServerListRecv(Sender: TObject;
SrvContactList: TList);
var
i : LongInt;
UserInfo: TUINEntry;
UINNickItem : PUINNickItem;
begin
if FullReloadContactList then
begin
FullReloadContactList := False;
Form2.lstContactList.Clear;
UINNickList.Clear;
end;
if SrvContactList.Count > 0 then
for i := 0 to SrvContactList.Count - 1 do
begin
UserInfo := PUINEntry(SrvContactList.Items[i])^;
if UserInfo.CType = 0 then (CType = 0),
begin
Form2.lstContactList.AddItem(UserInfo.Nick + ' (' + IntToStr(UserInfo.UIN) + ') - ' + GetStatusFor(UserInfo.UIN), Self);
GetMem(UINNickItem, SizeOf(UINNickItem^));
UINNickItem^.UIN := UserInfo.UIN;
UINNickItem^.Nick := UserInfo.Nick;
UINNickList.Add(UINNickItem);
end;
end;
ICQClient.DestroyUINList(SrvContactList);
end;
Вот так получаю:
Код:
FullReloadContactList := True;
Form1.ICQClient.RequestContactList;
Но, после компиляции ругается на строки в файле GetUserInfo (строку, на которую ругается компилятор я выделил):
Код:
procedure SetStatusToStatusList(UIN: String; Status: Cardinal);
var
UINStatusItem : PUINStatusItem;
i : LongInt;
InListAlready : Boolean;
begin
InListAlready := False;
if UINStatusList.Count > 0 then
for i := 0 to UINStatusList.Count - 1 do
if PUINStatusItem(UINStatusList.Items[i])^.UIN = StrToInt(UIN) then
begin
InListAlready := True;
PUINStatusItem(UINStatusList.Items[i])^.Status := Status;
end;
if InListAlready = False then
begin
GetMem(UINStatusItem, SizeOf(UINStatusItem^));
UINStatusItem^.UIN := StrToInt(UIN);
UINStatusItem^.Status := Status;
UINStatusList.Add(UINStatusItem);
end;
end;
И еще на файл ICQSock:
Код:
Buffer := @buf;
BufLen := rc;
if rc > 0 then
if Assync then
Synchronize(OnReceive)
И на это все, от сервера не дисконектит, но контакт-лист не получает
А исходник CheatICQ компилит нормально. Что я делаю не так???