Puede acceder mediante un programa al archivo de opciones de DMM y manipular sus opciones.
DNAXMLAccess.dll es un archivo DLL ATL COM compatible con la interfaz de IDispatch. Esto permite llamar el componente directamente desde un programa Visual Basic o cualquier lenguaje de secuencias de comandos compatible con los controles ActiveX. A continuación se muestran algunos ejemplos de las funciones que se utilizan en este acceso:
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);
Ejemplo de 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")
|
Copyright © 2013 CA.
Todos los derechos reservados.
|
|