I just want to use a RichEdit Control to display some text, not have any input, but I am having some problems with the StreamIn callback function. I just want to print a few characters like maybe "Hello World" but I can't get it to print anything to the control. The rest of my code is sound, but here is my StreamIn function:

StreamInProc proc hFile:DWORD,pBuffer:DWORD, NumBytes:DWORD, pBytesRead:DWORD
push edi

mov edi, pBuffer ; get address of buffer
mov , dword ptr "ABCD" ; Write ABCD to buffer

mov eax, pBytesRead ; Get address of variable for how many bytes have been written
mov , dword ptr 4 ; Say four bytes have been written.

return 1
pop edi
ret
StreamInProc endp

I could get it work correctly when I wanted to read a file in using a different StreamInProc, but I don't want the input to come from a file, rather my program. Here is the StreamInProc that worked:

StreamInProc proc hFile:DWORD,pBuffer:DWORD, NumBytes:DWORD, pBytesRead:DWORD
invoke ReadFile,hFile,pBuffer,NumBytes,pBytesRead,0
xor eax, 1
ret
StreamInProc endp
Posted on 2003-07-01 21:51:12 by StefanD
Hi StefanD,

Have you looked at Iczelion's RichEdit tutorials ?

http://spiff.tripnet.se/~iczelion/tutorials.html
Posted on 2003-07-01 22:18:56 by donkey
1. send a WM_SETTEXT message
2. use SetDlgItemText/SetDlgItemInt
Posted on 2003-07-01 22:33:28 by arkane
Just return 0 instead of 1 in your stream in proc. returning 1 will cancel the read process.
Posted on 2003-07-02 01:33:34 by japheth
Just before returning from the callback:



xor eax, 1


This works for me.
Posted on 2003-07-02 10:56:04 by El_Choni