分享方式:


CCachedDataPathProperty 類別

實作非同步傳輸且在記憶體檔案中快取的 OLE 控制項屬性。

語法

class CCachedDataPathProperty : public CDataPathProperty

成員

公用建構函式

名稱 描述
CCachedDataPathProperty::CCachedDataPathProperty 建構 CCachedDataPathProperty 物件。

公用資料成員

名稱 描述
CCachedDataPathProperty::m_Cache CMemFile 要在其中快取數據的物件。

備註

記憶體檔案會儲存在 RAM 中,而不是儲存在磁碟上,而且對於快速暫存傳輸很有用。

除了 CAysncMonikerFileCDataPathProperty之外, CCachedDataPathProperty 還提供在 OLE 控制件中使用異步 Moniker 的功能。 使用 CCachedDataPathProperty 物件時,您可以透過公用變數,以異步方式從URL或檔案來源傳輸數據,並將其儲存在記憶體檔案 m_Cache 中。 所有數據都會儲存在記憶體檔案中,除非您想要監看通知和回應,否則不需要覆寫 OnDataAvailable 。 例如,如果您要傳輸大型.GIF檔案,並想要通知控件已抵達更多數據,而且應該重新繪製本身,請覆寫 OnDataAvailable 以發出通知。

類別 CCachedDataPathProperty 衍生自 CDataPathProperty

如需如何在因特網應用程式中使用異步Moniker和ActiveX控件的詳細資訊,請參閱下列主題:

繼承階層架構

CObject

CFile

COleStreamFile

CMonikerFile

CAsyncMonikerFile

CDataPathProperty

CCachedDataPathProperty

需求

標頭: afxctl.h

CCachedDataPathProperty::CCachedDataPathProperty

建構 CCachedDataPathProperty 物件。

CCachedDataPathProperty(COleControl* pControl = NULL);

CCachedDataPathProperty(
    LPCTSTR lpszPath,
    COleControl* pControl = NULL);

參數

pControl
要與此 CCachedDataPathProperty 對象關聯的 ActiveX 控制件物件的指標。

lpszPath
路徑,可能是絕對或相對路徑,用來建立異步Moniker,參考屬性的實際絕對位置。 CCachedDataPathProperty 會使用 URL,而非檔名。 如果您想要檔案 CCachedDataPathProperty 的物件,請在路徑前面加上 file://。

備註

COleControl pControl指向的物件是由 Open 所使用,並由衍生類別擷取。 如果 pControl 為 NULL,則搭配 Open 使用的控件應該設定為 SetControl。 如果 lpszPath 為 NULL,您可以傳入Open路徑,或使用 SetPath 加以設定

CCachedDataPathProperty::m_Cache

包含要快取數據之內存檔案的類別名稱。

CMemFile m_Cache;

備註

記憶體檔案會儲存在 RAM 中,而不是儲存在磁碟上。

另請參閱

CDataPathProperty 類別
階層架構圖表
CDataPathProperty 類別