reference:plugins:vfs_plugins:vfs_init

VFS_Init(
     LPVFSINITDATA:lpInitData
)
→ BOOL

Arguments

lpInitData

[in] Points to a VFSINITDATA structure.

Return value

You should perform any initialization your plugin requires and then return TRUE to allow Opus to use your plugin. If you return FALSE Opus will not access your plugin again this session.

Description

The VFS_Init function is called immediately after Opus first loads your plugin DLL. It lets you perform initialization that may not be safe to perform inside the DllMain function (eg, opening other DLLs.)

The hwndDOpusMsgWindow field of the VFSINITDATA structure provides the window handle of the Plugin Support manager, which can be used to send several notification messages to Opus (documented in the Plugin Support API SDK.) The dwOpusVerMajor and dwOpusVerMinor fields provide the current version of Opus, and pszLanguageName provides the name of the currently selected language.

This function may seem similar to the VFS_Identify function, however Opus guarantees to only call VFS_Init once, immediately after your plugin DLL is loaded. Additionally, Opus will call the matching VFS_Uninit function when your plugin is released. You should use VFS_Init to perform any required initialization that may not be safe when placed in DllMain.

Note that if you return FALSE, Opus does not call VFS_Uninit.