Hey guys,
i'm working on a small project where the user is able to choose a font via a CFontDialog.
When the User selects a Font and Color from the ColorDialog i'm parsing the LOGFONT
Structure into a simple String and save this string in a text field.
The string have the basic structure "FaceName,size,color
"
Sample: Arial,10,#000000
Before i open the CFontDialog the next time, i parse the string back into a LOGFONT
structure.
Now i wan't to write a check function to check if the string is valid or not.
If the string contains invalid letters, i skip the part of the string while i parse it back to a LOGFONT structure, and the Dialog shows the initial values (in case of size = nothing).
But what if the our customer change the font and dont open the CFontDialog again? It's susceptible for errors.
Could anyone suggest me a way, how to check if the parameters are valid or not without opening the CFontDialog?
Then i could check if the parameter is valid when the user press the save button.
I know it is not the best way to implement a font control, but my boss want it this way (i have no idea why)