将 ole 对象插入 TRxRichEdit
我在程序中使用 TRxRichEdit。如何在运行时将 ole 对象插入 RxRichEdit。
I'm using TRxRichEdit in my program. How can I insert ole object to RxRichEdit at run time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果调用 RxRichEdit 的“InsertObjectDialog”方法,控件将执行“插入对象”对话框,用户可以在其中选择要重新创建的对象类型或从现有文件创建的对象类型。
我认为不使用对话框就不可能插入对象,因为 IRichEditOle 接口 (FRichEditOle) 是类私有的。编辑:
无论接口如何显然,无论是否对班级私有,都可以请求
IRichEditOle
接口直接从 RichEdit 控件本身使用EM_GETOLEINTERFACE
。下面是 D3 示例代码(我使用 RX 控件的最后一个版本),但它也可能适合 JVCL 的“TJvRichEdit”,它最初是相同的控件。该代码在运行时从文件名插入 Ole 对象:If you call "InsertObjectDialog" method of the RxRichEdit, the control executes the Insert Object dialog where the user can choose the type of the object to create anew or from an existing file.
I don't think it would be possible to insert an object without using the dialog, because the IRichEditOle interface (FRichEditOle) is private to the class.edit:
Regardless the interface being private or not to the class, apparently, one can request the
IRichEditOle
interface directly from the RichEdit control itself by usingEM_GETOLEINTERFACE
. Below is D3 sample code (the last version I used RX controls with), but it would also probably suit the 'TJvRichEdit' of JVCL, which is originally the same control. The code inserts an Ole object from a file name at run-time: