IVHooks interface : FileOpened method

FileOpened method
Event
A protocol file, runset file, or device file was opened.
Description
VWorks software calls the FileOpened method when the user opens a protocol file, a runset file, or a device file.
Syntax
 
HRESULT FileOpened(
[in] BSTR sXML,
[in, out] BSTR* sResultXML
);
Parameters
 
FileOpened method input
VWorks software passes a FileLoaded XML element into the sXML parameter of the FileOpened method. This XML element provides the file path of the file that was opened.
FileLoaded element
The FileLoaded element has the following attribute:
 
Example of FileLoaded method input
The following sample code is FileLoaded XML element that is received by the plugin from VWorks software as a string in the sXML parameter of the FileOpened method. VWorks software tells the plugin that the protocol file named protocol1.pro located in the C:\V11\V11 Files\Protocols directory was opened.
 
<FileLoaded Path='C:\V11\V11 Files\Protocols\protocol1.pro' />
FileOpened method output
The plugin returns a HookResults XML block in the sResultXML parameter of the FileOpened method. For information about the structure and contents of this XML block, see “HookResults XML block” .
Example of FileOpened method output
The following sample code is a HookResults XML block that is returned to VWorks software by the plugin as a string in the sResultXML parameter of the FileOpened method. The plugin tells VWorks software to write the following Info-type message to the Main Log:
protocol1.pro was opened.
 
<HookResults>
<Results>
<HookResult ResultType='Log Message'
ResultValue='protocol1.pro was opened.' />
</Results>
</HookResults>
Related information