View Issue Details

IDProjectCategoryView StatusLast Update
0001787JEDI VCL00 JVCL Componentspublic2004-07-23 03:48
ReporteranonymousAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0001787: TJvIpAddress component doesn't set correctly
DescriptionI'm having trouble setting this components text property on a form.create procedure. When trying to set the text property of this component in a form.create procedure, it returns 0.0.0.0

However setting it in the form.activate procedure, it works fine..

Shouldn't I be able to set the text value of this component in the form.create procedure?
Additional InformationSee attached zip file for a demo project.
TagsNo tags attached.

Activities

2004-05-20 12:28

 

example.zip (6,400 bytes)

ghendric

2004-05-20 12:29

reporter   ~0004311

This bug was submitted by ghendric

AHUser

2004-05-20 14:30

developer   ~0004312

I have no problems here (Delphi 6, JVCL 3 CVS)

user72

2004-05-21 04:38

  ~0004313

Might have something to do with whether the component has a handle or not when the Text poperty is accessed (what is the setting of OldCreateOrder for the form?). If that's the case, there is nothing we can do.

Try posting a message in FormCreate to the form and write a message handler that sets the IP. Something like:

const
  CM_SETIPADDRESS = CM_BASE + 1;

  TMyForm = class
    procedure CMSETIPADDRESS(var Message:TMessage): message CM_SETIPADDRESS;
  end;

implementation

procedure TMyForm.FormCreate();
begin
  PostMessage(Handle, CM_SETIPADDRESS, 0, 0);
end;

procedure TMyForm.CMSETIPADDRESS(var Message:TMessage): message CM_SETIPADDRESS;
begin
  JvIpAddress1.Text := '127.0.0.1';
end;
  
An alternative is to use FormActive the first time and then remove the OnActivate handler:

procedure TMyForm.FormActivate();
begin
  JvIpAddress1.Text := '127.0.0.1';
  MyForm.OnActivate := nil;
end;

BTW, I don't have this problem either.

Issue History

Date Modified Username Field Change
2004-05-20 12:28 anonymous New Issue
2004-05-20 12:28 anonymous File Added: example.zip
2004-05-20 12:29 ghendric Note Added: 0004311
2004-05-20 14:30 AHUser Note Added: 0004312
2004-05-21 04:38 user72 Note Added: 0004313
2004-05-24 01:15 user72 Status new => feedback
2004-07-23 03:48 AHUser Status feedback => closed