microsoft ole oracle

微软的OLE(Object Linking and Embedding,对象链接和嵌入)技术是一种通过指针相互传递信息的COM(Component Object Model,组件对象模型)协议,在不同应用程序和操作系统之间实现信息共享和交互的方式。例如,我们可以将一个Word文档中的表格嵌入到一个Excel表格中,或者在PowerPoint幻灯片中连接一个储存在Access数据库中的图像。

// 示例代码1: 实现OLE嵌入 object obj; string filename = "D:\\example.doc"; olestructole; ole = new OleObject(); ole.create(); obj = ole.bind(filename); ole.doverb(OLE.OLEIVERB_PRIMARY); // 示例代码2: 实现OLE连接 object obj1, obj2; olestructole1, ole2; ole1 = new OleObject(); ole2 = new OleObject(); ole1.create(); ole2.create(); obj1 = ole1.bind("excel.application"); obj2 = ole2.bind("word.application"); ole1.connect(obj1, "ActiveWorkbook"); ole2.connect(obj2, "Documents(1)"); ole1.doVerb(OLE.OLEIVERB_SHOW); ole2.doVerb(OLE.OLEIVERB_SHOW);