WorkspaceBrokerAx.InitializeWorkspaceConfiguration method

[InitializeWorkspaceConfiguration is no longer available for use as of Windows 10 and Windows Server 2016 Technical Preview.]

Called to initialize the state of the object. This method must be called before the object can be used.

Syntax

workspaceBrokerAx.initializeWorkspaceConfiguration();

Parameters

This method has no parameters.

Return value

This method does not return a value.

Examples

The following code example, from the RemoteApp and Desktop Connections workspace API sample, shows an example of calling the InitializeWorkspaceConfiguration method.

// Initialize the ActiveX control
try {
    wkspActiveX = Microsoft.Sample.WorkspaceBrokerApi.WorkspaceActiveX.createInstance();
} catch (e) {
    WinJS.log && WinJS.log("Error setting up the Workspace ActiveX control. Error: " + e.number + " " + e.description, "sample", "error");
    return;
}

try {
    wkspActiveX.InitializeWorkspaceConfiguration();
} catch (e) {
    if (e.number === -2147024894) {
        // This is equivalent to 0x80070002 (ERROR_FILE_NOT_FOUND), and is expected if you have never been subscribed to any workspaces on this machine
    } else {
        WinJS.log && WinJS.log("Error calling InitializeWorkspaceConfiguration: " + e.number + " " + e.description, "sample", "error");
        return;
    }
}

// Register for workspace subsciption results
wkspActiveX.attachEvent("OnWorkspaceSetupCompleted", onWorkspaceSetupCompletedHandler);

WinJS.log && WinJS.log("Workspace ActiveX control ready", "sample", "status");

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

End of client support

Windows 8.1

End of server support

Windows Server 2012 R2

IDL

Wkspbkax.idl

See also

WorkspaceBrokerAx