Click here to Skip to main content
15,920,217 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: new com port driver Pin
NiceNaidu24-May-06 20:49
NiceNaidu24-May-06 20:49 
Questionsingleton inheritance Pin
Krishnatv24-May-06 19:55
Krishnatv24-May-06 19:55 
AnswerRe: singleton inheritance Pin
Nibu babu thomas24-May-06 20:16
Nibu babu thomas24-May-06 20:16 
QuestionCRichEditCtrl Pin
VinayCool24-May-06 19:47
VinayCool24-May-06 19:47 
AnswerRe: CRichEditCtrl Pin
Nibu babu thomas24-May-06 20:25
Nibu babu thomas24-May-06 20:25 
AnswerRe: CRichEditCtrl Pin
Steve Echols24-May-06 20:30
Steve Echols24-May-06 20:30 
GeneralRe: CRichEditCtrl Pin
VinayCool24-May-06 20:44
VinayCool24-May-06 20:44 
GeneralRe: CRichEditCtrl [modified] Pin
Steve Echols24-May-06 21:05
Steve Echols24-May-06 21:05 
VinayCool wrote:
But at the end of edit of edit box i am getting some junk values as shown below.


You need a terminating null on the text (which I forgot):

Change the lines in bold:

<br />
 // allocate buffer for file contents<br />
char* text = new char[fileLen + 1];<br />
<br />
// read the file into the buffer<br />
fread(text, 1, fileLen, fp);<br />
<br />
// null terminate the string<br />
text[fileLen] = 0;<br />
<br />


VinayCool wrote:
Can u please also tell me how to highlight a particular word in the Rich edit box.


Like I mentioned yesterday, you can do somthing like:

CHARFORMAT cf;<br />
memset(&cf, 0, sizeof(CHARFORMAT));<br />
cf.cbSize = sizeof(CHARFORMAT);<br />
cf.dwMask = CFM_BOLD;<br />
cf.dwEffects = CFE_BOLD;<br />
<br />
// **** pseudo-code ****<br />
for (int i = 0; i < size of your word list; i++)<br />
{<br />
    m_FCONT.SetSel(word_position[i], word_length[i]);<br />
    m_FCONT.SetSelectionCharFormat(cf);<br />
}<br />


Hope that works!



- S
50 cups of coffee and you know it's on!

-- modified at 3:07 Thursday 25th May, 2006
GeneralRe: CRichEditCtrl [modified] Pin
VinayCool24-May-06 21:37
VinayCool24-May-06 21:37 
AnswerRe: CRichEditCtrl Pin
_anil_24-May-06 20:36
_anil_24-May-06 20:36 
GeneralRe: CRichEditCtrl Pin
VinayCool24-May-06 20:46
VinayCool24-May-06 20:46 
AnswerRe: CRichEditCtrl Pin
NiceNaidu24-May-06 20:40
NiceNaidu24-May-06 20:40 
GeneralRe: CRichEditCtrl Pin
VinayCool24-May-06 20:48
VinayCool24-May-06 20:48 
AnswerRe: CRichEditCtrl Pin
Hamid_RT24-May-06 20:53
Hamid_RT24-May-06 20:53 
QuestionOverwrite message box while using SHFileOperation to copy a file Pin
zahid_ash24-May-06 19:41
zahid_ash24-May-06 19:41 
AnswerRe: Overwrite message box while using SHFileOperation to copy a file Pin
Hamid_RT24-May-06 20:04
Hamid_RT24-May-06 20:04 
GeneralRe: Overwrite message box while using SHFileOperation to copy a file Pin
zahid_ash24-May-06 20:09
zahid_ash24-May-06 20:09 
GeneralRe: Overwrite message box while using SHFileOperation to copy a file Pin
Nibu babu thomas24-May-06 20:14
Nibu babu thomas24-May-06 20:14 
QuestionBase64String Pin
satsumatable24-May-06 19:24
satsumatable24-May-06 19:24 
Questionhow to get the return value when we select a checkbox Pin
keerthikaaa24-May-06 19:21
keerthikaaa24-May-06 19:21 
AnswerRe: how to get the return value when we select a checkbox Pin
_anil_24-May-06 19:40
_anil_24-May-06 19:40 
AnswerRe: how to get the return value when we select a checkbox Pin
NiceNaidu24-May-06 19:57
NiceNaidu24-May-06 19:57 
QuestionSafeArray Pin
satsumatable24-May-06 17:51
satsumatable24-May-06 17:51 
QuestionMpeg Decoder Pin
jayashri200624-May-06 16:26
jayashri200624-May-06 16:26 
QuestionGetWindowText [modified] Pin
Sam 200624-May-06 15:13
Sam 200624-May-06 15:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.