Friday, May 11, 2012 3:09 PM
I've asked this question over in the BCGSoft forums, but things seem to be pretty quiet over there and I thought I'd try here.
CMFCPropertyGridProperty uses the same format string (eg m_strFormatDouble) for scanning input (::TextToVar) and output formatting (::FormatProperty). This means that a format string that specifies precision, such as _T("%.3lf") for a property of type double (VT_R8), works fine in the CString.Format used for output, but fails in the _stscanf_s used for input in TextToVar. So, as far as I can see, there's no way to format the display of float or double properties, eg to restrict the display to 3 digits after the point.
Has anybody resolved this problem?
Saturday, May 12, 2012 9:47 AMI seem to have answered my own question here. I've redefined the TextToVar and FormatProperty functions in a class that inherits from CMFCPropertyGridProperty to do the correct formatting, and all's well now.
- Marked As Answer by Helen ZhaoModerator Monday, May 14, 2012 9:04 AM
Monday, May 14, 2012 9:03 AMModerator
I am gald to hear that you have fixed the issue. And thanks for sharing your experience & solution with us, which is realy very beneficial for other community members who have similar issues.
Thanks again for your active participation in the MSDN Forum.
Helen Zhao [MSFT]
MSDN Community Support | Feedback to us
Friday, May 18, 2012 3:28 PMCan you provide your code? I am fighting the same battle, and would love to borrow from someone who has already made it work!