Click here to Skip to main content
15,898,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Get Windows Standard Dialog Color Pin
master879-Jan-06 7:16
master879-Jan-06 7:16 
GeneralRe: Get Windows Standard Dialog Color Pin
Nish Nishant9-Jan-06 7:19
sitebuilderNish Nishant9-Jan-06 7:19 
GeneralRe: Get Windows Standard Dialog Color Pin
Nish Nishant9-Jan-06 7:20
sitebuilderNish Nishant9-Jan-06 7:20 
QuestionMapping Network drives Pin
Priya..k9-Jan-06 4:07
Priya..k9-Jan-06 4:07 
AnswerRe: Mapping Network drives Pin
David Crow9-Jan-06 4:20
David Crow9-Jan-06 4:20 
QuestionWhich Callback? Pin
Maciej Lisiewski9-Jan-06 3:48
Maciej Lisiewski9-Jan-06 3:48 
AnswerRe: Which Callback? Pin
Rage9-Jan-06 6:10
professionalRage9-Jan-06 6:10 
GeneralRe: Which Callback? Pin
Maciej Lisiewski9-Jan-06 6:34
Maciej Lisiewski9-Jan-06 6:34 
I haven't got a clue why am I getting only the first char. It could happen with a unicode string read as single byte char string, but that's not the case. And it's true for every string I came up with, which, again, proves your theory wrong (I really wish it was that simple, I really do).

If anybody has any idea what's the problem - do write. Meanwhile I'll get myself an unhealthly large cup of coffee hoping to finish the code before my heart explodes Wink | ;-)


More on the subject: if I stream rft into CRich.. as unicode (sf_rtf|sf_unicode) and read it as (sf_text) I get whole string with some characters replaced with '?', which is normal.
It it's (sf_rtf) in and (sf_text|sf_unicode) out I get just the first char (sligtly odd..)
(sf_rtf|sf_unicode) + (sf_text|sf_unicode) exacly the same.
Conclusion:
(sf_text|sf_unicode) = getting 1 char regardles of the string.


Could you look at the code please? I can't find the mistake (I hardly see anything being awake like 50 hours Wink | ;-) )


DWORD CALLBACK CAutoRichEditCtrl::CBStreamOut(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CString sThisWrite;
sThisWrite.GetBufferSetLength(cb);

CStringW *psBuffer = (CStringW *)dwCookie;

for (int i=0;i<cb;i++) {
sThisWrite.SetAt(i,*(pbBuff+i));
}

*psBuffer += sThisWrite;

*pcb = sThisWrite.GetLength();
sThisWrite.ReleaseBuffer();
return 0;
}


[..]

EDITSTREAM es;
es.dwError = 0;
es.pfnCallback = CBStreamOut;
CStringW theStringYouShouldBeLookingAt = _T(" ");
es.dwCookie = (DWORD) &theStringYouShouldBeLookingAt;
StreamOut(SF_TEXT, es); //(SF_TEXT|SF_UNICODE, es);

[..]


Maciej Lisiewski
Bioengineered coffee2code converter

-- modified at 12:58 Monday 9th January, 2006
GeneralRe: Which Callback? Pin
Rage9-Jan-06 8:12
professionalRage9-Jan-06 8:12 
Questionthread and standard Input (stdin) Pin
hellomoin9-Jan-06 3:33
hellomoin9-Jan-06 3:33 
QuestionError Message Tables - who to implement them Pin
Sebastian Schneider9-Jan-06 2:47
Sebastian Schneider9-Jan-06 2:47 
QuestionRe: Error Message Tables - who to implement them Pin
David Crow9-Jan-06 3:03
David Crow9-Jan-06 3:03 
AnswerRe: Error Message Tables - who to implement them Pin
Rage9-Jan-06 6:18
professionalRage9-Jan-06 6:18 
AnswerRe: Error Message Tables - who to implement them Pin
Blake Miller9-Jan-06 7:09
Blake Miller9-Jan-06 7:09 
AnswerRe: Error Message Tables - who to implement them Pin
Sebastian Schneider9-Jan-06 20:11
Sebastian Schneider9-Jan-06 20:11 
QuestionHow to read from a text file? Pin
Amarelia9-Jan-06 2:14
Amarelia9-Jan-06 2:14 
AnswerRe: How to read from a text file? Pin
Chris Losinger9-Jan-06 2:18
professionalChris Losinger9-Jan-06 2:18 
AnswerRe: How to read from a text file? Pin
toxcct9-Jan-06 2:21
toxcct9-Jan-06 2:21 
QuestionRe: How to read from a text file? Pin
David Crow9-Jan-06 3:06
David Crow9-Jan-06 3:06 
QuestionPrinter Monitoring Pin
micutzu9-Jan-06 1:44
micutzu9-Jan-06 1:44 
AnswerRe: Printer Monitoring Pin
David Crow9-Jan-06 3:09
David Crow9-Jan-06 3:09 
GeneralRe: Printer Monitoring Pin
Dudi Avramov9-Jan-06 4:07
Dudi Avramov9-Jan-06 4:07 
GeneralRe: Printer Monitoring Pin
David Crow9-Jan-06 4:18
David Crow9-Jan-06 4:18 
GeneralRe: Printer Monitoring Pin
micutzu10-Jan-06 1:55
micutzu10-Jan-06 1:55 
Questioncreate window Pin
Anu_Bala9-Jan-06 1:04
Anu_Bala9-Jan-06 1:04 

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.