Home » Community » Newbie corner » Sigh, SetData / GetData...
Sigh, SetData / GetData... [message #50684] |
Wed, 05 December 2018 04:32  |
ptkacz
Messages: 89 Registered: March 2017
|
Member |
|
|
The following are defined:
EditDouble editDouble;
DocEdit docEdit;
...
docEdit.SetData(editDouble.GetData());
The last line of code above, causes the application to CRASH!
Peter
|
|
|
Re: Sigh, SetData / GetData... [message #50685 is a reply to message #50684] |
Wed, 05 December 2018 06:28  |
|
Hi Peter,
ptkacz wrote on Wed, 05 December 2018 04:32The following are defined:
docEdit.SetData(editDouble.GetData());
The last line of code above, causes the application to CRASH!
That is to be expected Get/SetData() works with Value, which can hold several datatypes but it doesn't perform any implicit conversions. To get the value from editDouble as string, you need to use ToString() or operator~(): docEdit.SetData(editDouble.GetData().ToString());
// or
docEdit.SetData(~editDouble.GetData());
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Fri May 09 20:20:29 CEST 2025
Total time taken to generate the page: 0.00497 seconds
|