Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Sigh, SetData / GetData...
Sigh, SetData / GetData... [message #50684] Wed, 05 December 2018 04:32 Go to next message
ptkacz is currently offline  ptkacz
Messages: 79
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 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1756
Registered: August 2008
Location: Czech Republic
Senior Contributor

Hi Peter,

ptkacz wrote on Wed, 05 December 2018 04:32
The following are defined:
docEdit.SetData(editDouble.GetData());

The last line of code above, causes the application to CRASH!


That is to be expected Smile 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
Previous Topic: Extending an existing widget...
Next Topic: Issue compiling U++ version 12603 on OpenSuse Leap 15
Goto Forum:
  


Current Time: Thu Dec 13 05:59:50 CET 2018

Total time taken to generate the page: 0.00657 seconds