Strip OLE标题信息(MS Access / SQL Server) [英] Strip OLE header information (MS Access / SQL Server)

查看:134
本文介绍了Strip OLE标题信息(MS Access / SQL Server)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要支持二进制数据库内容(图像等)的C ++应用程序。使用MS Access或MS SQL Server时,此数据将包装在OLE对象中。如何剥离此OLE标题信息?注意,我不能只查找特定标签的开头,因为内容可以是png,jpg和其他格式的整堆。应该使用类似COleDataObject?

I have a C++ application that needs to support binary database content (images, etc). When using MS Access or MS SQL Server this data is wrapped inside an OLE object. How do I strip this OLE header information? Note that I can't just look for the beginning of a specific tag as the content can be png, jpg and a whole heap of other formats. Should I use something like COleDataObject?

推荐答案

使用MS Access 2007(我需要测试其他MS数据库) :

Using MS Access 2007 (I need to test other MS databases) the format seems to be:

84 bytes
file name + \0
full path + \0
5 bytes + [2] bytes (the third byte of those five bytes)
temp path + \0
4 bytes
actual data (if not using a link to the file)

到目前为止,我只是在实际数据之前解析和剥离部分,但我仍然想知道是否有没有办法使用类似COleDataSource来帮助更强大地解析这些信息。

So far I simply parse and strip the part before the actual data, but I'm still wondering if there's no way to use something like COleDataSource to help parse this information more robustly.

还要注意,这种格式只适用于通用内容(开始标记0x15 0x1c 0x32)。当使用位图(开始标记0x15 0x1c 0x2f)时,有一个78字节的固定偏移,当使用PowerPoint(开始标记0x15 0x1c 0x34)时,有一个固定的95字节偏移。

Also note that this format only applies for generic content (start tag 0x15 0x1c 0x32). When using bitmaps (start tag 0x15 0x1c 0x2f) there's a fixed offset of 78 bytes and when using PowerPoint (start tag 0x15 0x1c 0x34) there's a fixed offset of 95 bytes.

这篇关于Strip OLE标题信息(MS Access / SQL Server)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆