Platform SDK: Team Productivity Update |
The RegisterAppFactory method notifies the Team Productivity Update that an application is available for instantiation within a Team Workspace. This method is called during an application's setup on the server computer.
[C++]
HRESULT RegisterAppFactory(
BSTR* pbstrFactoryID,
BSTR bstrInstantiate,
TeamAppFactoryType type,
BSTR bstrFriendlyName,
BSTR bstrIconPath,
BSTR bstrDescription
);
[Visual Basic]
Function RegisterAppFactory(
bstrInstantiate As String,
type As TeamAppFactoryType,
bstrFriendlyName As String,
[bstrIconPath As String = "0"],
[bstrDescription As String = "0"]) As String
The following table describes the constants passed to indicate the instantiation mode an application can invoke.
Constant | Integer value | Usage |
---|---|---|
TAFT_LINK | 1 | When an application only puts a link on a Team Workspace and supports none of the Team Workspace interfaces. |
TAFT_DEPLOY | 2 | When an application can instantiate itself without any input from an administrator or Team Workspace owner. |
TAFT_FACTORY | 3 | When the application needs information from the Team Workspace owner prior to instantiation. When this value is passed, bstrInstantiate must return an XML stream that specifies a URL for Configure, a URL for Deploy, and an optional URL for Cancel. For more information, see Instantiation URL: Configure URL and DeployURL. |
For a discussion of sample code that uses the TeamAppManager::RegisterAppFactory method, see TeamAppManager Method Calls .
The following code sample creates an instance of the TeamAppManager object and calls the RegisterAppFactory method. This procedure handles the Register button's Click event on the form described in Gathering Parameters with a Visual Basic Form. Note that the code uses a combo box control to gather the TeamAppFactoryType parameter.
Private Sub cmdRegister_Click() Dim oTK As TeamAppManagerLib.TeamAppManager On Error GoTo ErrorHandler ' Create a new instance of the TeamAppManager Set oTK = New TeamAppManagerLib.TeamAppManager ' Register the application with the TPU and display the new FactoryID (GUID) txtFactoryIDResult.Text = oTK.RegisterAppFactory( _ txtInstantiateURL.Text, _ cmbTeamFactoryType.ItemData(cmbTeamFactoryType.ListIndex), _ txtFriendlyName.Text, _ txtIconPath.Text, _ txtDescription.Text) ' Cleanup Set oTK = Nothing Exit Sub ErrorHandler: MsgBox Err.Description End Sub