Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: You're riding the wrong train, it seems. Pin
Hamid_RT25-Oct-07 5:14
Hamid_RT25-Oct-07 5:14 
GeneralRe: About waveinopen Pin
Nishad S25-Oct-07 17:08
Nishad S25-Oct-07 17:08 
QuestionWhere I heve to set thread In my application?? Pin
ashishbhatt25-Oct-07 0:21
ashishbhatt25-Oct-07 0:21 
AnswerRe: Where I heve to set thread In my application?? Pin
Mattias G25-Oct-07 3:56
Mattias G25-Oct-07 3:56 
AnswerRe: Where I heve to set thread In my application?? Pin
led mike25-Oct-07 4:17
led mike25-Oct-07 4:17 
QuestionProblem in retriving drivers fully qualified file name using Win32 API Pin
manish_c24-Oct-07 23:57
manish_c24-Oct-07 23:57 
AnswerRe: Problem in retriving drivers fully qualified file name using Win32 API Pin
JudyL_MD25-Oct-07 2:56
JudyL_MD25-Oct-07 2:56 
QuestionCRichEditCtrl mystery - selection, streaming and formatting Pin
Mattias G24-Oct-07 23:51
Mattias G24-Oct-07 23:51 
My problem is this:

I use SetSel() and SendMessage(EM_SETCHARFORMAT, ...) to highlight stuff in the control, and it works fine when using SetWindowText() to set the contents of the control. However, when I use streaming for setting the contents, and if the selection to highlight starts at the first character position (CHARRANGE.cpMin = 0), the highlighting is applied to the entire contents of the control. Moreover, the formatting remains when I fill the control with new text, even if I don't highlight anything in the new text.

Reproducable with:
<br />
// streaming callback function<br />
int nTransfer;<br />
<br />
nTransfer = _tcslen(m_pchStreamBuf);<br />
if(nTransfer > cb)<br />
	nTransfer = cb;<br />
memmove(pbBuff, m_pchStreamBuf, nTransfer);<br />
*pcb = nTransfer;<br />
m_pchStreamBuf += nTransfer;<br />
return 0;<br />
<br />
// formatting<br />
CHARFORMAT2 cf;<br />
memset(&cf, 0, sizeof(cf));<br />
cf.cbSize      = sizeof(cf);<br />
cf.dwMask      = CFM_COLOR | CFM_BACKCOLOR;<br />
cf.crTextColor = RGB(0x00, 0, 0);<br />
cf.crBackColor = RGB(0x00, 0xff, 0xff);<br />
m_ctrl.SetSel(0, 3);<br />
m_ctrl.SendMessage(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);<br />


Anyone?
QuestionOpenProcess API returns NULL for pid 0 and 4. Pin
manish_c24-Oct-07 23:20
manish_c24-Oct-07 23:20 
AnswerRe: OpenProcess API returns NULL for pid 0 and 4. Pin
ThatsAlok25-Oct-07 0:58
ThatsAlok25-Oct-07 0:58 
QuestionRe: OpenProcess API returns NULL for pid 0 and 4. Pin
David Crow25-Oct-07 3:01
David Crow25-Oct-07 3:01 
Questionaccess c: drive Pin
p_24-Oct-07 23:04
p_24-Oct-07 23:04 
AnswerRe: access c: drive Pin
ThatsAlok25-Oct-07 2:14
ThatsAlok25-Oct-07 2:14 
GeneralRe: access c: drive [modified] Pin
jhwurmbach25-Oct-07 4:58
jhwurmbach25-Oct-07 4:58 
GeneralRe: access c: drive Pin
Waldermort25-Oct-07 5:11
Waldermort25-Oct-07 5:11 
GeneralRe: access c: drive Pin
jhwurmbach25-Oct-07 5:22
jhwurmbach25-Oct-07 5:22 
GeneralRe: access c: drive Pin
ThatsAlok25-Oct-07 5:22
ThatsAlok25-Oct-07 5:22 
GeneralRe: access c: drive Pin
jhwurmbach25-Oct-07 5:25
jhwurmbach25-Oct-07 5:25 
GeneralRe: access c: drive Pin
ThatsAlok25-Oct-07 5:38
ThatsAlok25-Oct-07 5:38 
GeneralRe: access c: drive Pin
jhwurmbach25-Oct-07 5:57
jhwurmbach25-Oct-07 5:57 
GeneralRe: access c: drive Pin
Roger Broomfield25-Oct-07 6:25
Roger Broomfield25-Oct-07 6:25 
GeneralRe: access c: drive Pin
jhwurmbach25-Oct-07 6:31
jhwurmbach25-Oct-07 6:31 
GeneralRe: access c: drive Pin
Roger Broomfield25-Oct-07 7:01
Roger Broomfield25-Oct-07 7:01 
QuestionWindows Redraw Issues Pin
neil478124-Oct-07 22:42
neil478124-Oct-07 22:42 
AnswerRe: Windows Redraw Issues Pin
Nishad S25-Oct-07 0:44
Nishad S25-Oct-07 0:44 

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.