ILockBytes

Windows Mobile 6.5
https://msdn.microsoft.com/zh-cn/library/aa911496(en-us,MSDN.10).aspx

这个接口是一个字节数组对象上实现由一些物理存储,如磁盘文件,全局内存或数据库。

它使用一个组件对象模型(COM)复合文件存储对象给其根存储访问物理设备,而隔离根存储访问物理存储的细节。

什么时候实现

大多数应用程序不会实现ILockBytes 因为COM接口提供了实现最常见的一种情况:

基于文件的实现 如果你所说的StgCreateDocfile函数创建一个复合文件存储对象,它包含的一个实现ILockBytes 这是关联到一个字节数组存储在一个物理磁盘文件。

复合文件存储对象调用ILockBytes 方法。 你不叫他们直接在这个实现。

有些情况下,这将是有用的为应用程序提供它自己的ILockBytes 实现。

例如,一个数据库应用程序可以实现ILockBytes 创建一个字节数组对象支持的存储的关系表。 然而,强烈建议您使用COM-provided实现。

讨论了使用COM实现的优点,而不是创建自己的看到StgCreateDocfileOnILockBytes函数,它创建了一个复合文件存储对象的调用者提供的字节数组对象。

什么时候使用

ILockBytes COM的实现方法IStorageIStream复合文件对象的接口。

除非你正在实施IStorage IStream ,你不需要打电话ILockBytes 直接的方法。

如果你写你自己的ILockBytes 实现,您可以使用StgCreateDocfileOnILockBytes函数创建一个复合文件存储对象支持的实现ILockBytes 

方法

下面的表显示了这个接口的方法按字母顺序排列的。

方法 描述

冲洗

确保维护的任何内部缓冲区字节数组对象写入到存储支持。

LockRegion

限制访问指定范围的字节数组。

ReadAt

读取指定的字节数在指定偏移位置开始从一开始的数组。

SetSize

字节数组的大小变化。

统计

检索STATSTG 这个字节数组对象结构。

UnlockRegion

删除之前限制的访问限制在一个范围的字节ILockBytes:LocRegion 

WriteAt

写入指定数量的字节数组中指定的位置。

讲话

确定平台是否支持这个接口,明白了Determining Supported COM APIs.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

This interface is implemented on a byte array object that is backed by some physical storage, such as a disk file, global memory, or a database.

It is used by a Component Object Model (COM) compound file storage object to give its root storage access to the physical device, while isolating the root storage from the details of accessing the physical storage.

When to Implement

Most applications will not implement the ILockBytes interface because COM provides implementations for one of the most common situations:

File-based implementation If you call the StgCreateDocfile function to create a compound file storage object, it contains an implementation of ILockBytes that is associated with a byte array stored in a physical disk file.

The compound file storage object calls the ILockBytes methods. You do not call them directly in this implementation.

There are situations in which it would be useful for an application to provide its own ILockBytes implementation.

For example, a database application could implement ILockBytes to create a byte array object backed by the storage of its relational tables. However, it is strongly recommended that you use the COM-provided implementations.

For a discussion of the advantages of using the COM implementations rather than creating your own, see the StgCreateDocfileOnILockBytes function, which creates a compound file storage object on top of a caller-provided byte array object.

When to Use

The ILockBytes methods are called by the COM implementations of the IStorage and IStream interfaces on the compound file object.

Unless you are implementing IStorage and IStream, you would not need to call ILockBytes methods directly.

If you write your own ILockBytes implementation, you can use the StgCreateDocfileOnILockBytes function to create a compound file storage object backed by your implementation of ILockBytes.

Methods

The following table shows the methods for this interface in alphabetical order.

Method Description

Flush

Ensures that any internal buffers maintained by the byte array object are written out to the backing storage.

LockRegion

Restricts access to a specified range of bytes in the array.

ReadAt

Reads a specified number of bytes starting at a specified offset from the beginning of the array.

SetSize

Changes the size of the byte array.

Stat

Retrieves a STATSTG structure for this byte array object.

UnlockRegion

Removes the access restriction on a range of bytes previously restricted with ILockBytes::LocRegion.

WriteAt

Writes a specified number of bytes to a specified location in the array.

Remarks

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

ILockBytes Windows Mobile 6.5相关推荐

  1. Windows Mobile 6.0 SDK和中文模拟器下载

    [转] Windows Mobile 6.0 SDK和中文模拟器下载 Windows Mobile 6.5 模拟器 2010年12月06日 星期一 07:48 转载自 zhangyanle86 终于编 ...

  2. Ring Tone Manager on Windows Mobile

    2019独角兽企业重金招聘Python工程师标准>>> 手机铃声经常能够体现一个人的个性,有些哥们儿在自习室不把手机设置成震动,一来电就@#$^%^@&^%#$&$* ...

  3. windows mobile做一个摄象头预览程序

    zdirectshow的原理大概大家都知道,基本就是用微软封装的接口来实现硬件无关性,但是最终调用的接口都要在驱动层有对应的实现: 为了更清楚地演示directshow的数据传输过程,我必须说明的这个 ...

  4. 刚开始Windows Mobile的开发,请大家多多关照

    刚开始学习Windows Mobile的开发,现在正在学习WML和WAP的网站制作,请大家多多关照. 转载于:https://www.cnblogs.com/czha2002/archive/2005 ...

  5. Memory Information on Windows Mobile(续)

    在<Memory Information on Windows Mobile>一文中,讲述了Windows Mobile 6 Professional SDK中的一个关于在今日插件中显示内 ...

  6. 辨别 Windows CE, Windows XP Embedded 和 Windows Mobile

    很多人都没有接触过各种智能设备,现在市面的智能设备"千奇百怪",如何辨别它们? 回想起我自己真是惭愧,做了一年多的 Windows Mobile 开发后,我才知道 Windows ...

  7. Windows Mobile 7 梦幻之旅系列1之- What’s New?

     (本文全文直译自InsideMicrosoft,仅供学习参考,如引用请表明译文出处,谢谢)       微软正在开发新一代的智能手机平台Windows Mobile 7,它将是一个革命性的智能手机操 ...

  8. Windows Mobile 设备中心 for vista 一览

    Microsoft Windows Mobile 设备中心 6.1  在6月6日发布了最新版,今天为了能在Vista开发PPC(或Wince设备)程序,下载安装了该程序,启动后界面确实很炫,和媒体中心 ...

  9. Windows Mobile下访问Sqlite的Native C++封装

    背景 当前移动设备开发领域,在本地数据存储方面,Sqlite几乎成了事实标准,Andriod (android.database.sqlite),iPhone (SQLite for iPhone S ...

最新文章

  1. 在客户端调用MOSS的搜索服务,实现更加灵活的搜索控制
  2. 实现透明渐变的Activity
  3. 【控制】《多无人机协同控制技术》周伟老师-第2章-多无人机协同控制体系结构
  4. TensorFlow 1.0正式发布
  5. 基于VHDL自动售邮票机设计
  6. 《Head First 设计模式》阅读笔记(一)——策略模式
  7. django 更改默认数据库为MySQL
  8. 如何在word 打钩 打叉
  9. 史诗级中日韩新字体诞生:思源黑体(Source Han Sans)
  10. 2011年戴尔服务器型号,PowerEdge 11G R310机架式服务器
  11. 连接网络打印机报错0x000003e3
  12. 国内外部分源软件镜像站和部分软件官方网站
  13. 函数sum计算机怎么使用方法,sumif函数的使用方法
  14. python调用函数库_python调用操作系统的库函数
  15. 世界最高山峰是珠穆朗玛峰(8844.43米=8844430毫米),假如我有一张足够大的纸,它的厚度是0.1毫米。请问,我折叠多少次,可以折成珠穆朗玛峰的高度?
  16. 应用市场免费推广资源合集
  17. vue : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本
  18. 银川清华计算机技术培训,银川有没有本地IT技能培训?
  19. 顺应EMM趋势,烽火星空重磅出击
  20. uAvionix获得FAA合同,部署和演示多个无人机同时飞行的C波段频率分配管理(FAM)

热门文章

  1. php 文件迭代对象,通过PHP中的stdClass对象进行迭代
  2. 配置Nginx实现负载均衡
  3. 04 ffmpeg 从媒体文件解封装,输出YUV420图像
  4. 缓存的Cache Aside模式
  5. 微软职位内部推荐-SW Engineer II for Azure Network
  6. PHP分页代码实例教程
  7. 被困69天后,智利矿工重返人间
  8. 看了两篇园子里的文章,初步懂了点接口的涵义
  9. 【bzoj5082】弗拉格 矩阵乘法
  10. Linux系统运维之Zookeeper集群配置