您可以有计划地访问和控制 DMM 选项文件中的选项。
DNAXMLAccess.dll 是一个支持 IDispatch 接口的 ATL COM DLL(组件动态链接库)。 因此,可从 Visual Basic 程序或任何支持 ActiveX 控件的脚本语言中直接调用组件。 下面显示了本次访问中所用的一些成员函数示例:
HRESULT SetFile([in] BSTR bstrFile);
HRESULT SetStringOption([in] BSTR bstrOption, [in] BSTR bstrValue);
HRESULT GetStringOption([in] BSTR bstrOption, [out, retval] BSTR* bstrValue);
HRESULT SetBoolOption([in] BSTR bstrOption, [in] VARIANT_BOOL fValue); [out, retval] VARIANT_BOOL* fValue);
HRESULT GetBoolOption([in] BSTR bstrOption,
HRESULT SetIntOption([in] BSTR bstrOption, [in] LONG lValue);
HRESULT GetIntOption([in] BSTR bstrOption, [out, retval] LONG* lValue);
Visual Basic 示例:
REM Create the CPM object for accessing Options file DIM XMLAccess As CNAXMLAccessor Set XMLAccess = New DNAXMLAccessor REM Set the file to use for subsequent XML calls, use the file path you copied above. XMLAccess.SetFile "c:\SomeFile\Path\To\MigrationSpecific\ XMLFile.xml" REM Set any options that need to be customized for this migration REM BOOL, INT, and STRING options are set like this: XMLAccess.SetBoolOption "Network log
XMLAccess.SetStringOption "command line", "/D" "c:\MyDNAFile.DNA" "/T" "C:\MyTemplateFile.dtf"" /M /X"
REM Get any options that need to be retrieved after this migration
REM BOOL, INT, and STRING options are retrieved like this:
Dim StringVal As String
DIM BoolVal as Boolean
Dim IntVal As Integer
BoolVal = XMLAccessGetBool-Option("Network log enabled?’)
StringVal = XMLAccess.GetStringOption("Network log level")
|
版权所有 © 2014 CA Technologies。
保留所有权利。
|
|