Scripting with axcomhelper
In addition to the preferred method using the registry settings, there is a technical method using a wrapper for the changes. The 64-bit server setup installs and registers a 32-bit version of our default COM modules under \<SERVER_INSTALL>\win32\. The axcomhelper.exe component also installed there is a wrapper around arbitrary COM modules and should be included in your scripts to instantiate a 32-bit COM module and use it in the following code. The following description applies to your scripts when you create COM objects using CreateObject.
In a server script, an instance of this wrapper is passed to you via the 'RunningContext', which determines whether the server is a 32-bit or a 64-bit version.
By overwriting the Windows function for instantiating a COM object with your own script function in a central location, you can now execute your previous script code on both a 32-bit and 64-bit server.
An example implementation of such a function in a workflow-side server script is shown below:
Function CreateObject(ClassName)
Set CreateObject = Nothing
If runningcontext.comhlp32 Is Nothing Then
runningcontext.logger.Error "Der COM-Helper 'axcomhlp32.exe' steht nicht zur Verfügung"
Exit Function
End If
runningcontext.comhlp32.Is64Bit = runningcontext.Is64BitServer
Set CreateObject = runningcontext.comhlp32.CreateObject(ClassName)
End Function
Please note that the 'RunningContext' is addressed as 'rc' in DMS-side scripts.