Board index » cppbuilder » Property is empty when it isn't
JD
![]() CBuilder Developer |
JD
![]() CBuilder Developer |
Property is empty when it isn't2004-07-03 05:16:46 AM cppbuilder48 I have an AnsiString property that is set in the IDE and I want to use in the components constructor but when I do, the property is empty. For example, the following displays an empty string: if( !ComponentState.Contains(csDesigning) ) { ShowMessage( PropertyName ); } However, if I check it in the form's constructor it displays correctly. ~ JD |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2004-07-03 06:42:17 AM
Re:Property is empty when it isn't
"JD" < XXXX@XXXXX.COM >wrote in message
QuoteI have an AnsiString property that is set in the IDE wait until the property is actually assigned before you can use its value. QuoteHowever, if I check it in the form's constructor |
JD
![]() CBuilder Developer |
2004-07-03 02:00:03 PM
Re:Property is empty when it isn't
"Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote:
QuoteYou cannot do what you are asking for. Property values have the end of the world. ~ JD {smallsort} |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2004-07-03 04:26:27 PM
Re:Property is empty when it isn't
"JD" < XXXX@XXXXX.COM >wrote in message
QuoteNot what I wanted to hear. Gambit |
JD
![]() CBuilder Developer |
2004-07-03 05:57:54 PM
Re:Property is empty when it isn't
"Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote:
QuoteThen you need to explain exactly what you are trying to will handle 'authorizing' the application to run. The desired visual effect is to have zero screen output if the program is not authorized to run so using the properties in the ctor seemed like the solution. If I hard code the properties, it works as expected but that defeats the point of having something that's reusable. I just want to be able to drop it, set it and forget it. I just thought of this but I'm not sure how to impliment. I could move the code in the ctor to an Activate method, set the application's ShowMainForm to false in the ctor, start a thread that waits for streaming to finish and terminates in such a way as to cause the Activate method to execute. The Activate method then either sets ShowMainForm to true or calls Application->Terminate. How 'bout that? ~ JD |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2004-07-03 06:08:38 PM
Re:Property is empty when it isn't
"JD" < XXXX@XXXXX.COM >wrote in message
QuoteThe ultimate objective to have a component that can before you then act on them. QuoteThe desired visual effect is to have zero screen output QuoteIf I hard code the properties, it works as expected QuoteI could move the code in the ctor to an Activate method, |
JD
![]() CBuilder Developer |
2004-07-04 03:16:47 AM
Re:Property is empty when it isn't
"Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote:
QuoteThen you should override the component's Loaded() method so QuoteWhy use a component for that? Just check the credentials executables but there are enough and you wouldn't believe some of the stuff - well YOU would - that these guys put in there. QuoteWhat about using premade components/libraries that already do that? because that's what we get paid for). It's hard to argue with that. QuoteThat is not a good design choice. |