+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    ratws
    Guest

    Question Adding parameters to a procedure

    This is from Turkey's Reverse Connection example.
    Procedure EnunConnections;(ListConnections)
    var
    i : integer;
    begin
    for i := 0 To ServerSocket1.Socket.ActiveConnections -1 do
    begin ConnectionsListBox.Items.add(ServerSocket1.Socket. Connections[i].RemoteHost);

    Since i'm using a ListView instead of a ListBox i'm getting an error at the last line "Too many actual parameters" So.. i understand that i have to redeclare the procedure using parameters to fix this problem, but i'm a little lost on that. How this procedure should look like ?

  2. #2
    Rami
    Guest
    if your probloem is in how adding items to a ListView use this code:
    var
    Sin: TListItem;
    begin
    Sin := SinList.Items.Add;
    Sin.Caption := 'Hello'

  3. #3
    Retired Admin
    Join Date
    Feb 2005
    Location
    Norway
    Posts
    1,933
    u have to change

    Code:
    ConnectionsListBox.Items.add(ServerSocket1.Socket. Connections[i].RemoteHost);

  4. #4
    ratws
    Guest
    Well, i probably didn't explain it well.ListView replacing a listbox (ConnectionsListBox)
    Listview1.Items.add(ServerSocket1.Socket. Connections[i].RemoteHost);
    And this is the problem,so..what to do ??

    Let me correct it. I know i should change that line though, this is what's driving me crazy,i can't find a solution, that's why i tried to change the procedure declaration to accept it.

    OK, better i explain what i want to do.
    I want the remote host displayed in a blank square( any component..) associated to an icon. All right now it's clear i guess !

  5. #5
    Retired Admin
    Join Date
    Feb 2005
    Location
    Norway
    Posts
    1,933
    Code:
    Procedure EnunConnections;
    var
    i : integer;
    myListview:tlistitem;
    begin
    
    myListview:=listview1.Items.Add;
    for i := 0 To ServerSocket1.Socket.ActiveConnections -1 do
    begin myListview.Caption:=ServerSocket1.Socket.Connections[i].RemoteHost;
    end;

  6. #6
    Senior Member -silent-'s Avatar
    Join Date
    May 2005
    Posts
    1,374
    I want the remote host displayed in a blank square( any component..) associated to an icon
    yeah i like that set out ratws
    00101101 01110011 01101001 01101100 01100101 01101110 01110100 00101101


  7. #7
    ratws
    Guest
    Quote Originally Posted by LttCoder
    Code:
    Procedure EnunConnections;
    var
    i : integer;
    myListview:tlistitem;
    begin
    
    myListview:=listview1.Items.Add;
    for i := 0 To ServerSocket1.Socket.ActiveConnections -1 do
    begin myListview.Caption:=ServerSocket1.Socket.Connections[i].RemoteHost;
    end;
    Thanks boss ! I was trying to use the Caption propertie but i was missing the obvious...
    Thanks again !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sending file procedure - help
    By TruvaDonkey in forum General Programming Help
    Replies: 10
    Last Post: 28-03-2006, 19:58
  2. Adding lomswebserver to Lttloger? How?
    By TruvaDonkey in forum General Programming Help
    Replies: 2
    Last Post: 04-09-2005, 00:10
  3. Adding VNC capabilities to a RAT
    By ratws in forum Delphi Help
    Replies: 7
    Last Post: 29-07-2005, 15:14
  4. Timer procedure
    By ratws in forum Delphi Help
    Replies: 21
    Last Post: 21-07-2005, 21:09
  5. Unistallserver procedure.
    By warrior in forum General Programming Help
    Replies: 6
    Last Post: 19-05-2005, 04:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.