Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class does not contain a member - but it does.

Status
Not open for further replies.

adrianxw

Programmer
Apr 10, 2007
7
DK
I have a class in a package which contains a public member, a property in fact. If I view the class in the structure window, I can see the member declared as public.

If I try to use this class in another program, I get the error "Tclassname" does not contain a member named "name".

Why would it not see the member when it would appear to be visible?
 
show the class code plz. this will be easier to help you out

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
The class contains over 2000 lines of code. The value I want is only mentioned on a few lines though. It sort of reduces to this...

Tclassname = class(TComponent)
private
{ Private declarations }
FTimeStamp: TDateTime;
protected
{ Protected declarations }
public
{ Public declarations }
property TimeStamp: TDateTime read FTimeStamp;
published
{ Published declarations }
end;

... with FTimeStamp being set upon receipt of certain events.

In the calling program, I am trying to set...

Value := Class.TimeStamp;

... nothing real fancy.
 
If I try to use this class in another program, I get the error "Tclassname" does not contain a member named "name".


what has timestamp to do with the error? do you have a name property or not??

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
I have a private class member called FTimeStamp, and a public property called TimeStamp which allows it to be read by programs instantiating this class.

When, in a calling program, I say...

x := Class.TimeStamp;

... I see an error saying Class does not contain a member etc., thus TimeStamp has everything to do with it!
 
so the class you are using is in a runtime package? (the bpl must be distributed with the app)

if this is the case, do you have the same problem when not using runtime packages?

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
The .bpl file is loaded into the IDE, and I can pull components from the palette into the application. I do not distribute the .bpl.

That said, the problem has "gone away". I don't know what I did to correct this, although I have found that if I have both the client and the component loaded into the IDE at the same time, frequently, changes to one, do not appear in the other straight away - closing the IDE and restarting it seems to fix it. I did try that in this instance and it appeared not to work, but perhaps I goofed somewhere.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top