Platform SDK: Team Productivity Update |
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)
For a discussion of sample code that uses the TeamAppManager::UnregisterAppFactory method, see TeamAppManager Method Calls.
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