Re:Pointer reference
Quote
"Martin, Bertrand" <mbertr...@nitrex.com> writes:
> How can I make Text property of TEdit point to a char* ( or some other
> pointer).
You can't.
Quote
> My goal is to assign an element from my structure to a TEdit.
That's ok.
Quote
> Exemple:
> Struct
> {
> char *Name;
> };
That won't work.
Quote
> I Would like Edit1->Text to point to Struct.Name that way when the
> value in my structure changes so will the content of my edit box.
That can't be done. The Edit box's data is stored in the windows
control itself, and that cannot be changed. The best you can do is
write a class that has private data that is accessible through
functions (or properties, if you're into that) and the setter function
updates the edit box as well as updating the internal data.
But even so, it'd be easy for the two objects to get out of sync.
What you want will be very brittle, and when anything changes you may
find it breaks.
Why can't your structure just know about the editbox, and provide
access to get/set the data of the editbox without having a local copy?
Then they're always in sync because there is only one place the data
is stored -- in the edit box itself.
--
Chris (TeamB);