项目中需要在后台调用svn下载代码,前台使用mfc的edit控件展示下载日志
如何实现当然是使用createprocess创建个后台进程下载代码,然后createpipe通过管道获取下载信息,这个网上有很多的例子
通过如下代码可以使edit conrol不断增加日志信息,且滚动到最底部。缺陷就是在下载过程中,无法选中内容,不知道还有没更好的办法,那估计就要重载这个控件了
-
int nLength
= edit.
GetWindowTextLength
(
);
-
// put the selection at the end of text
-
edit.
SetSel
(nLength, nLength
);
-
// replace the selection
-
edit.
ReplaceSel
(pszText
);