看MSDN的EditStreamCallback函数说明;
下面是关键:The control calls the callback function repeatedly, transferring a portion of the data with each call. The control continues to call the callback function until one of the following conditions occurs: The callback function returns a nonzero value.
The callback function returns zero in the *pcb parameter.
The value returned in the *pcb parameter is less than the number of bytes requested in the cb parameter.
An error occurs that prevents the rich edit control from transferring data into or out of itself. Examples are out-of-memory situations, failure of a system function, or the read buffer contains an invalid character.
For a stream-in operation, the RTF code contains data specifying the end of an RTF block.
For a stream-in operation on a single-line edit control, the callback reads in a CRLF.
下面是关键:The control calls the callback function repeatedly, transferring a portion of the data with each call. The control continues to call the callback function until one of the following conditions occurs: The callback function returns a nonzero value.
The callback function returns zero in the *pcb parameter.
The value returned in the *pcb parameter is less than the number of bytes requested in the cb parameter.
An error occurs that prevents the rich edit control from transferring data into or out of itself. Examples are out-of-memory situations, failure of a system function, or the read buffer contains an invalid character.
For a stream-in operation, the RTF code contains data specifying the end of an RTF block.
For a stream-in operation on a single-line edit control, the callback reads in a CRLF.
解决方案 »
- 如何获得Job作业里进程ID列表?
- windows程序设计第四章,SYSMETS出现错误,错误信息如下,这是什么原因啊,大牛们,帮帮忙吧
- 关于WH_MOUSE_LL的问题
- !想不通的问题.!
- 动态网格
- 对JPG图像研究深的朋友加我QQ,有项目单子,急~~~~~~~~~~~~~~~~~~~~~~
- 求一个技术解决方案,网络编程高手+数据库高手来看看
- 请教各位大牛一个问题啊
- 虚拟总线驱动是挂载在什么驱动上面的??
- jpg和文本内容如何保存在一个文件中
- 讨论:我朋友想在csdn成为专家,有什么好建议?呵呵,应该很容易的吧?
- 如何实现在256色下抖动显示24bit图像,不用drawdibdraw,希望告知详细算法,先谢了
乱说话是会影响了老师讲课的情绪的,
就算是不影响老师的情绪,
影响到同学的听课也是不好的吗?
return 1;表示完了!!!
你一直return 0;当然就不停运行喽!!!
The callback function returns zero to indicate success.The callback function returns a nonzero value to indicate an error. If an error occurs, the read or write operation ends and the rich edit control discards any data in the pbBuff buffer.
如果我返回非0值,控件会清空Buffer,另外MSDN有一个例子:
DWORD CALLBACK EditStreamCallback (DWORD dwCookie,
LPBYTE pbBuff, LONG cb, LONG FAR *pcb)
{
ReadFile ((HANDLE)dwCookie, pbBuff, cb, pcb, NULL);
if (*pcb < cb)
return 0; // file has been fully read in
else
return (DWORD) *pcb; // more to read
}
The control calls the callback function repeatedly, transferring a portion of the data with each call. The control continues to call the callback function until one of the following conditions occurs: The callback function returns a nonzero value.
The callback function returns zero in the *pcb parameter.
An error occurs that prevents the rich edit control from transferring data into or out of itself. Examples are out-of-memory situations, failure of a system function, or an invalid character in the read buffer.
For a stream-in operation, the RTF code contains data specifying the end of an RTF block.
For a stream-in operation on a single-line edit control, the callback reads in an end-of-paragraph character (CR, LF, VT, LS, or PS). 有五种情况可以结束回调函数的执行。