DVP_ViewerCacheLoadW(
     LPCWSTR:szPathOrName,
     LPSTREAM:lpStream,
     HANDLE:hAbortEvent,
     size_t*:pCacheSizeBytes
)
→ HANDLE

Arguments

szPathOrName

[in] Path or name of the file

lpStream

[in] Stream to read the file from

hAbortEvent

[in] An event that is set to abort loading

pCacheSizeBytes

[out] Receives the size of the cache data in bytes

Return value

A handle to the cache data. Opus passes this handle to your viewer window in the lParam of the DVPLUGINMSG_LOADCACHEW message.

Description

The DVP_ViewerCacheLoadW function is called to load a file into cache data, which is later passed to your viewer window with the DVPLUGINMSG_LOADCACHEW message.

A plugin that handles DVPLUGINMSG_LOADCACHEW must also implement DVP_ViewerCacheLoadW and DVP_ViewerCacheFree.

When the viewer window receives DVPLUGINMSG_LOADCACHEW, wParam is the name of the file and lParam is the cache data handle. The name should only be used for display or verification, not to re-open the file, because it could be a path into an archive or similar, and no stream is provided. If the message returns FALSE, Opus then uses the normal DVPLUGINMSG_LOADW or DVPLUGINMSG_LOADSTREAMW routes. You can therefore store parts of the file in your cache data but intentionally fail if you need to get the file or stream open again to finish loading.

There is no ANSI version of this function.

This function was added in Directory Opus 12.0 (VIEWERPLUGINVERSION 12000).