Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Turbo Delphi and Indy9/10 Problem

78 views
Skip to first unread message

Ed Faulk

unread,
Oct 24, 2006, 4:08:34 PM10/24/06
to
I'm in the process of developing a program to help do some very specific
network performance analysis. To start the process, I need to ping a machine
to see if it is alive or not. I'm using Turbo Delphi (not the .NET version).
I have a TIdIcmpClient defined and have specified the IdIcmpClient in the
uses section (along with several other Indy components that are needed). It
compiles fine under Delphi 6, but under Turbo Delphi I get an error message
that says: "Field frmMain.ICMP does not have a corresponding component.
Remove the declarations?"

It appears as if the compiler is not looking into the Indy dcu to find the
appropriate information. Does anyone have any ideas on this (other than
telling me to stick with Delphi 6 which may be my option at this point)?

Thanks,
Ed


Liz

unread,
Oct 24, 2006, 4:31:46 PM10/24/06
to
Ed Faulk wrote:

> I'm in the process of developing a program to help do some very
> specific network performance analysis. To start the process, I need
> to ping a machine to see if it is alive or not. I'm using Turbo
> Delphi (not the .NET version).

Pro or explorer?

> I have a TIdIcmpClient defined and
> have specified the IdIcmpClient in the uses section (along with
> several other Indy components that are needed). It compiles fine
> under Delphi 6, but under Turbo Delphi I get an error message that
> says: "Field frmMain.ICMP does not have a corresponding component.
> Remove the declarations?"

If you open that form you'd see the same right?

Can you find idicmpclient in your list of installed components under
turbo?

If not, I cant think back but does pro come with indy? if not you may
need to install it, and if it does come with indy did you pick 9 or 10?

--
Liz the Brit
Delphi things I have released: http://www.xcalibur.co.uk/DelphiThings

Remy Lebeau (TeamB)

unread,
Oct 24, 2006, 5:05:07 PM10/24/06
to

"Ed Faulk" <efa...@beckman.com> wrote in message
news:453e72c9$1...@newsgroups.borland.com...

> It compiles fine under Delphi 6, but under Turbo Delphi I get an
> error message that says: "Field frmMain.ICMP does not have a
> corresponding component. Remove the declarations?"

That happens if the TForm has a component declaration in its published
section, but does not have a cooresponding object in the DFM. Did you drop
the TIdIcmpClient component onto the form visially in the IDE designer? Or
are you creating it dynamically in your code? If the latter, then you
should not have put the component declaration in the published section.
That is reserved for the designer's use.

> It appears as if the compiler is not looking into the Indy dcu to
> find the appropriate information.

That has nothing to do with it.


Gambit


Ed Faulk

unread,
Oct 24, 2006, 5:22:46 PM10/24/06
to
Here's where I started -- the PingGUI example from Indy:

unit Main;

interface

uses
Windows, Messages, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
SysUtils, Classes, IdIcmpClient, IdBaseComponent, IdComponent, IdRawBase,
IdRawClient,
Spin;

type
TfrmPing = class(TForm)
lstReplies: TListBox;
ICMP: TIdIcmpClient;
Panel1: TPanel;
btnPing: TButton;
edtHost: TEdit;
Label1: TLabel;
PingCount: TEdit;
procedure btnPingClick(Sender: TObject);
procedure ICMPReply(ASender: TComponent; const ReplyStatus:
TReplyStatus);
private
public
end;

Obviously I've removed the SpinControl but had hoped the rest would work.
Since I'm using Explorer instead of Pro I cannot drop the component but must
manually add it (unless there's some technique I'm unaware of).

Ed

"Remy Lebeau (TeamB)" <no....@no.spam.com> wrote in message
news:453e8030$1...@newsgroups.borland.com...

Peter Below (TeamB)

unread,
Oct 26, 2006, 5:39:49 PM10/26/06
to
Ed Faulk wrote:

> I'm in the process of developing a program to help do some very
> specific network performance analysis. To start the process, I need
> to ping a machine to see if it is alive or not. I'm using Turbo
> Delphi (not the .NET version). I have a TIdIcmpClient defined and
> have specified the IdIcmpClient in the uses section (along with
> several other Indy components that are needed). It compiles fine
> under Delphi 6, but under Turbo Delphi I get an error message that
> says: "Field frmMain.ICMP does not have a corresponding component.
> Remove the declarations?"

If you create components in code and assign them to fields of the form
you also added yourself, do *not* add these fields to the
IDE-maintained section of the form class declaration, put them under
the private section.


--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Ed Faulk

unread,
Oct 31, 2006, 1:21:50 PM10/31/06
to
Peter,

I thought I understood what you said, but apparently not. Here's the salient
portion of the code (as I thought you said I should restructure it) from the
Indy pingGUI demo:

unit Main;

interface

uses
Windows, Messages, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
SysUtils, Classes, IdIcmpClient, IdBaseComponent, IdComponent, IdRawBase,
IdRawClient,
Spin;


type
TfrmPing = class(TForm)
lstReplies: TListBox;

Panel1: TPanel;
btnPing: TButton;
edtHost: TEdit;
Label1: TLabel;
PingCount: TEdit;
procedure btnPingClick(Sender: TObject);

private


procedure ICMPReply(ASender: TComponent; const ReplyStatus:
TReplyStatus);

public
end;

var
frmPing: TfrmPing;
ICMP: TIdIcmpClient;

implementation
{$R *.DFM}

procedure TfrmPing.btnPingClick(Sender: TObject);
var
i, j,iErr: integer;
begin
ICMP.OnReply := ICMPReply;
ICMP.ReceiveTimeout := 1000;
btnPing.Enabled := False; try
ICMP.Host := edtHost.Text;
lstReplies.Clear;
Val(PingCount.Text, j, iErr);
for i := 1 to j do begin
ICMP.Ping;
Application.ProcessMessages;
end;
finally btnPing.Enabled := True; end;
end;

I consistently blow up on the ICMP.OnReply := ICMPReply statement. I guess I
don't understand what I am doing wrong...

Ed

"Peter Below (TeamB)" <none> wrote in message
news:xn0esxx2...@newsgroups.borland.com...

Robert Priestley

unread,
Nov 1, 2006, 3:46:59 AM11/1/06
to
Hi ED,

You haven't created your instance (ICMP) of TIdIcmpClient hence your AV.

If you want create components at runtime in code then add them to the
private section of the forms class and preferably prefix them with an F e.g
FCmpClient.

But most importantly, remember to actually create the component. e.g
FCmpClient := TidcmpClient.Create(nil) befire you use it.

Then equally importantly, ensure you free it as well when you have finished
with it, e.g FCmpClient.Free or FreeAnfNil(FCmpClient);

Hope this helps. Look at Delphi help on object creation also.

Rob.


"Ed Faulk" <efa...@faswebdesign.com> wrote in message
news:4547943b$1...@newsgroups.borland.com...

Ed Faulk

unread,
Nov 2, 2006, 3:39:44 AM11/2/06
to
Rob,

Thanks -- that's precisely what was missing. I guess it's been too many
years since I did any Windows programming (did some Java five years ago, but
been in management ever since). Now I'm developing tools for my use with my
performance group and having to relearn what I once knew.

Ed

"Robert Priestley" <RPries...@SpamVectaplc.com> wrote in message
news:4548...@newsgroups.borland.com...

0 new messages