Unable to format text in a RichEdit, not using MFC
-
Hi, all :) I have created a RichEdit box (version 1.0) using regular windows API (no MFC) but I can’t seem to format (using the SendMessage() function) any part of the text in the control. I have tested both formatting the paragraphs (
PARAMFORMAT
structure) and characters (CHARFORMAT
structure) but nothing seems to get displayed. The return values (from bothEM_SETPARAFORMAT
andEM_SETCHARFORMAT
flags) are nonzero, which indicates success. I know that I am setting the cbSize and the dwMask structure members correctly because after setting the format, I useEM_GETPARAFORMAT
andEM_GETCHARFORMAT
flags to check if the changes was actually made, and it is (but just not displayed). This experience is really strange, I really don’t know what I am doing wrong or missing. And I can’t seem to find any examples on formatting text in a Rich Edit without using MFC. Any ideas on how to solve this or find any examples are greatly appreciated. Thanks in advance Aidman » over and out We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying. -
Hi, all :) I have created a RichEdit box (version 1.0) using regular windows API (no MFC) but I can’t seem to format (using the SendMessage() function) any part of the text in the control. I have tested both formatting the paragraphs (
PARAMFORMAT
structure) and characters (CHARFORMAT
structure) but nothing seems to get displayed. The return values (from bothEM_SETPARAFORMAT
andEM_SETCHARFORMAT
flags) are nonzero, which indicates success. I know that I am setting the cbSize and the dwMask structure members correctly because after setting the format, I useEM_GETPARAFORMAT
andEM_GETCHARFORMAT
flags to check if the changes was actually made, and it is (but just not displayed). This experience is really strange, I really don’t know what I am doing wrong or missing. And I can’t seem to find any examples on formatting text in a Rich Edit without using MFC. Any ideas on how to solve this or find any examples are greatly appreciated. Thanks in advance Aidman » over and out We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.hehe... I found the problem, when I declared the PARAMFORMAT and the CHARMFORMAT structures I forgot setting them to zero, which caused the variable members (who wasn’t later set to any specific value) to have unpredictable values. Anyways it was a clumsy mistake :-O Aidman » over and out We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.