Platform SDK: Team Productivity Update

TeamAppManager::UnregisterAppFactory[C++]

TeamAppManager.UnRegisterAppFactory[Visual Basic]

The UnregisterAppFactory method removes a Team Workspace registered application from the Team Productivity Update database. This method is called when an application is uninstalled from the server computer.

[C++]
HRESULT UnregisterAppFactory(
    BSTR bstrFactoryID,
);

[Visual Basic]
Sub UnregisterAppFactory(bstrFactoryID As String)

Parameter

bstrFactoryID
[in] The GUID used by the Team Productivity Update to identify a Team Workspace registered application. This should be the same GUID passed to RegisterAppFactory during setup.

Return Values

S_OK
The application was successfully removed from the TPU database.
E_FAIL
The application was not successfully removed from the TPU database.

Example[C++]

For a discussion of sample code that uses the TeamAppManager::UnregisterAppFactory method, see TeamAppManager Method Calls.

Example[Visual Basic]

The following sample code handles the Unregister button's Click event on the form described in Gathering Parameters with a Visual Basic Form. First, the code creates an instance of the TeamAppManager object. When the code calls the UnregisterAppFactory method, it passes the Team Application Factory ID that is stored in the Text property of the txtFactoryIDResult text box control on the Visual Basic form discussed earlier. The code then clears the text boxes on the form and releases the reference to the TeamAppManager object.

Private Sub cmdUnregister_Click()
    Dim oTK As TeamAppManagerLib.TeamAppManager
    Dim sFactoryID As String
    
    On Error GoTo ErrorHandler
    
    ' Create a new instance of the TeamAppManager
    Set oTK = New TeamAppManagerLib.TeamAppManager
    
    ' Unregister the application using the FactoryID (GUID)
    Call oTK.UnregisterAppFactory(txtFactoryIDResult.Text)
    
    ' Display the Unregistered
    txtFactoryIDResult.Text = ""
    txtFriendlyNameResult.Text = ""
    
    ' Cleanup
    Set oTK = Nothing
    
    Exit Sub
ErrorHandler:
    MsgBox Err.Description
End Sub