Platform SDK: Team Productivity Update

TeamAppManager::FriendlyNameFromGuid[C++]

TeamAppManager.FriendlyNameFromGuid[Visual Basic]

The FriendlyNameFromGuid method maps the GUID that identifies a specific instance of a team application to the application's friendly name. This method can be used by an application to construct any directory structures the application needs.

[C++]
HRESULT FriendlyNameFromGUID(
    BSTR bstrFactoryID,
    BSTR* pbstrFriendlyName,
);

[Visual Basic]
Function FriendlyNameFromGUID(bstrFactoryID As String) As String

Parameters

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.
pbstrFriendlyName[C++]
[out, retval] The friendly name passed to the Team Productivity Update during the original call to TeamAppManager::RegisterAppFactory().

Return Values[C++]

S_OK
The application's friendly name was successfully mapped to the GUID for the instance.
E_FAIL
The method failed to map the friendly name successfully.

Return Value[Visual Basic]

pbstrFriendlyName
The friendly name passed to the Team Productivity Update during the original call to TeamAppManager.RegisterAppFactory().

Example[C++]

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

Example[Visual Basic]

The following code sample handles the Friendly Name button's Click event on the form discussed in Gathering Parameters with a Visual Basic Form. After creating an instance of the TeamAppManager object, the code passes the GUID held in the Text property of the txtFactoryIDResult text box control to the FriendlyNameFromGUID method. This code displays a registered Team Application's friendly name in the txtFriendlyNameResult text box control on a Visual Basic form.

Private Sub cmdFriendlyName_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
    
    ' Get and display the friendly name based on the FactoryID (GUID)
    txtFriendlyNameResult.Text = oTK.FriendlyNameFromGUID(txtFactoryIDResult.Text)
    
    ' Cleanup
    Set oTK = Nothing
    
    Exit Sub
ErrorHandler:
    MsgBox Err.Description
End Sub