在CRicheditCtrl中用InSertObject插入一个activex对象以后??在关闭这个richedit的时候要怎么释放这个插入的对象???

blackboxboyb 2004-11-29 11:25:32
不释放这个对象会有memory leaks~~~

谢谢!!!!
...全文
134 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhu_teky 2005-01-31
  • 打赏
  • 举报
回复
m_lpObject->Release();
m_lpObject = NULL;
fangcheng 2005-01-07
  • 打赏
  • 举报
回复
msdn上那个项下有例子,谢谢
kingzai 2004-11-29
  • 打赏
  • 举报
回复
see msdn example
blackboxboyb 2004-11-29
  • 打赏
  • 举报
回复
m_lpObject是什么东西啊??
~~~

kingzai 2004-11-29
  • 打赏
  • 举报
回复
//call this:
if (m_lpObject)
{
m_lpObject->Release();
m_lpObject = NULL;
}
for more that hwo to use InSertObject,see
HOWTO: Insert a Bitmap Into an RTF Document Using the RichEdit Control

Q220844


danyueer 2004-11-29
  • 打赏
  • 举报
回复
The rich edit control automatically increments the reference count for the interfaces if it holds onto them, so the caller can safely release the interfaces if they are not needed.

从MSDN里面的上述说明,我们可以看到,当RichEdit关闭以后要,主调程序要负责释放对象,否则会造成内存泄漏。

15,976

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧