CPB Mailing List

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The damnedest problem?!?!?



Hi,

> 1.  You are trying to assign an integer value ( i+1 ) to a string
> property of the TEdit.  I'm surprised it compiles.
> 

Assigning an integer to an AnsiString is perfectly acceptable - in this case it
would generate an implicit call to the __fastcall AnsiString::AnsiString( int)
constructor, creating a temporary String variable, and then a call to
AnsiString& __fastcall AnsiString::operator=(const AnsiString&), to perform the
actual assignment.

The general rule is that the compiler will search first through the operator='s,
and then the constructors of the type on the left hand side of the assignment.

> 2.  Why are you calling Repaint()???  The TEdit will automatically
> update and repaint itself when you assign the property a correct
> string value.

If it's like other controls, the edit box won't repaint it's contents until the
app enters a message processing cycle - so if you do a lot of updates which hog
cycles from the normal message processing, that's when you use repaint.

Hope this helps,
giles


Lanny Grim wrote:
...


W Komornicki's Home Page | Main Index | Thread Index