ILockBytes Windows Mobile 6.5

來源:互聯網
上載者:User

標籤:jid   tin   ora   common   ant   資料   interface   term   檔案   

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的實現方法 IStorage 和 IStream 複合檔案對象的介面。

除非你正在實施 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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.