Click here to Skip to main content
15,888,733 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How can run our application as a Service? Pin
Hamid_RT24-Apr-09 0:04
Hamid_RT24-Apr-09 0:04 
QuestionHow can the callback function streamout be called back about richeditor' StreamOut function. Pin
sunhaiminbnu23-Apr-09 16:25
sunhaiminbnu23-Apr-09 16:25 
AnswerRe: How can the callback function streamout be called back about richeditor' StreamOut function. Pin
Stuart Dootson23-Apr-09 21:56
professionalStuart Dootson23-Apr-09 21:56 
The callbacks should be normal functions, not class methods (unless they're static methods, of course). I've just found this code in my archives that writes text out of a richedit control called rich_.

DWORD __stdcall EditStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
   LPCWSTR a = LPCWSTR(pbBuff);
   if (dwCookie == 100)
   {
      // pbBuff[0] to pbBuff[cb-1] contain the text of the rich-edit control.
   }
   return 0;
}

void CMyDlg::OnBnStreamOut()
{
   EDITSTREAM es = { 100, 0, &EditStreamCallback };
   rich_.StreamOut(SF_TEXT, es);
}


Note that where I've specified '100', you can specify any pointer value like (say) the pointer to your CRichEditorDlg object, so you could call back into the object from the callback if you needed.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

QuestionTrapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
EvScott23-Apr-09 12:38
EvScott23-Apr-09 12:38 
AnswerRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
Stuart Dootson23-Apr-09 12:50
professionalStuart Dootson23-Apr-09 12:50 
GeneralRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
EvScott23-Apr-09 12:55
EvScott23-Apr-09 12:55 
GeneralRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
Stuart Dootson23-Apr-09 13:03
professionalStuart Dootson23-Apr-09 13:03 
GeneralRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
EvScott23-Apr-09 13:53
EvScott23-Apr-09 13:53 
GeneralRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
Stuart Dootson23-Apr-09 14:29
professionalStuart Dootson23-Apr-09 14:29 
GeneralRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
EvScott23-Apr-09 15:05
EvScott23-Apr-09 15:05 
GeneralRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
Stuart Dootson23-Apr-09 15:27
professionalStuart Dootson23-Apr-09 15:27 
GeneralRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
EvScott23-Apr-09 15:45
EvScott23-Apr-09 15:45 
GeneralRe: Trapping WM_KEYDOWN and WM_KEYUP on entering text in edit control Pin
EvScott23-Apr-09 16:28
EvScott23-Apr-09 16:28 
Questionadding percentage to calculator Pin
icechef23-Apr-09 12:04
icechef23-Apr-09 12:04 
AnswerRe: adding percentage to calculator Pin
EvScott23-Apr-09 12:48
EvScott23-Apr-09 12:48 
GeneralRe: adding percentage to calculator Pin
icechef23-Apr-09 20:51
icechef23-Apr-09 20:51 
AnswerRe: adding percentage to calculator Pin
CPallini23-Apr-09 21:24
mveCPallini23-Apr-09 21:24 
QuestionThreadsafe Data Class Pin
softwaremonkey23-Apr-09 6:40
softwaremonkey23-Apr-09 6:40 
AnswerRe: Threadsafe Data Class Pin
Stuart Dootson23-Apr-09 6:56
professionalStuart Dootson23-Apr-09 6:56 
GeneralRe: Threadsafe Data Class Pin
softwaremonkey23-Apr-09 7:07
softwaremonkey23-Apr-09 7:07 
GeneralRe: Threadsafe Data Class Pin
Stuart Dootson23-Apr-09 7:10
professionalStuart Dootson23-Apr-09 7:10 
GeneralRe: Threadsafe Data Class Pin
softwaremonkey23-Apr-09 9:03
softwaremonkey23-Apr-09 9:03 
GeneralRe: Threadsafe Data Class Pin
led mike23-Apr-09 9:04
led mike23-Apr-09 9:04 
GeneralRe: Threadsafe Data Class Pin
Stuart Dootson23-Apr-09 9:16
professionalStuart Dootson23-Apr-09 9:16 
GeneralRe: Threadsafe Data Class Pin
led mike23-Apr-09 10:09
led mike23-Apr-09 10:09 

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.