Vous pouvez accéder à un fichier d'options DMM et modifier les options par programme.
DNAXMLAccess.dll est fichier DLL ATL COM qui prend en charge l'interface IDispatch. Un composant peut ainsi être appelé directement à partir d'un programme Visual Basic ou de tout langage de script prenant en charge les contrôles ActiveX. Quelques exemples de fonctions membre utilisées pour accéder aux fichiers DNA sont présentés ci-après :
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);
Exemple 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 © 2014 CA.
Tous droits réservés.
|
|