Object Model Reference for GUI Testing > Utility Objects > Utility Statements > CreateObject64 Statement

CreateObject64 Statement

Description

Creates a 64-bit COM object and returns a reference to it.

Syntax

Set MyNewObject = CreateObject64(objectProgID)

Argument

Type

Description

ProgID

String

The ProgID of the 64-bit COM object you want to create.

Return Value

Variant. Returns a reference to the created object.

IMPORTANT

If you run a CreateObject64 step on a 32-bit computer, it will create a 32-bit COM object like the standard VBScript CreateObject statement.

Tip: If your application installs different modules for 64-bit and 32-bit clients, you may still want to check whether the test is running on a 64-bit or 32-bit computer.

To do this, you can use a function such as this:

 Function Is64BitMachine

    Dim oShell
    Dim OsType

    Set oShell = CreateObject("WScript.Shell")
    OsType = oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")

    If OsType = "x86" Then
        Is64BitMachine = False
    Else
        Is64BitMachine = True
    End If

End Function

 

See also: