Click here to Skip to main content
14,867,123 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
MemberHamid_RT25-Oct-07 5:14 
GeneralRe: About waveinopen Pin
Nishad S25-Oct-07 17:08
MemberNishad S25-Oct-07 17:08 
QuestionWhere I heve to set thread In my application?? Pin
ashishbhatt25-Oct-07 0:21
Memberashishbhatt25-Oct-07 0:21 
AnswerRe: Where I heve to set thread In my application?? Pin
Mattias G25-Oct-07 3:56
MemberMattias G25-Oct-07 3:56 
AnswerRe: Where I heve to set thread In my application?? Pin
led mike25-Oct-07 4:17
Memberled mike25-Oct-07 4:17 
QuestionProblem in retriving drivers fully qualified file name using Win32 API Pin
manish_c24-Oct-07 23:57
Membermanish_c24-Oct-07 23:57 
AnswerRe: Problem in retriving drivers fully qualified file name using Win32 API Pin
JudyL_MD25-Oct-07 2:56
MemberJudyL_MD25-Oct-07 2:56 
QuestionCRichEditCtrl mystery - selection, streaming and formatting Pin
Mattias G24-Oct-07 23:51
MemberMattias 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
Membermanish_c24-Oct-07 23:20 
AnswerRe: OpenProcess API returns NULL for pid 0 and 4. Pin
ThatsAlok25-Oct-07 0:58
MemberThatsAlok25-Oct-07 0:58 
QuestionRe: OpenProcess API returns NULL for pid 0 and 4. Pin
David Crow25-Oct-07 3:01
MemberDavid Crow25-Oct-07 3:01 
Questionaccess c: drive Pin
p_24-Oct-07 23:04
Memberp_24-Oct-07 23:04 
AnswerRe: access c: drive Pin
ThatsAlok25-Oct-07 2:14
MemberThatsAlok25-Oct-07 2:14 
GeneralRe: access c: drive [modified] Pin
jhwurmbach25-Oct-07 4:58
Memberjhwurmbach25-Oct-07 4:58 
GeneralRe: access c: drive Pin
Waldermort25-Oct-07 5:11
MemberWaldermort25-Oct-07 5:11 
GeneralRe: access c: drive Pin
jhwurmbach25-Oct-07 5:22
Memberjhwurmbach25-Oct-07 5:22 
GeneralRe: access c: drive Pin
ThatsAlok25-Oct-07 5:22
MemberThatsAlok25-Oct-07 5:22 
GeneralRe: access c: drive Pin
jhwurmbach25-Oct-07 5:25
Memberjhwurmbach25-Oct-07 5:25 
GeneralRe: access c: drive Pin
ThatsAlok25-Oct-07 5:38
MemberThatsAlok25-Oct-07 5:38 
GeneralRe: access c: drive Pin
jhwurmbach25-Oct-07 5:57
Memberjhwurmbach25-Oct-07 5:57 
GeneralRe: access c: drive Pin
Roger Broomfield25-Oct-07 6:25
MemberRoger Broomfield25-Oct-07 6:25 
GeneralRe: access c: drive Pin
jhwurmbach25-Oct-07 6:31
Memberjhwurmbach25-Oct-07 6:31 
GeneralRe: access c: drive Pin
Roger Broomfield25-Oct-07 7:01
MemberRoger Broomfield25-Oct-07 7:01 
QuestionWindows Redraw Issues Pin
neil478124-Oct-07 22:42
Memberneil478124-Oct-07 22:42 
AnswerRe: Windows Redraw Issues Pin
Nishad S25-Oct-07 0:44
MemberNishad 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.