IMSCSAuthManager2::GetProperty Method [C++]

Use this method to retrieve the value of the specified custom property from the current user ticket.

Definition

[C++]

HRESULT IMSCSAuthManager::GetProperty(EnumMSCS_TicketTypeenumTicketType,
  BSTRpropName,
  VARIANT*pVarCustomPropVal);

[Visual Basic]

Function GetProperty(enumTicketType As EnumMSCS_TicketType,
  propName As String) As Variant

Parameters

  • enumTicketType[C++]
    [in] An EnumMSCS_TicketType that indicates the type of ticket that contains the property.
  • enumTicketType[Visual Basic]
    [in] An EnumMSCS_TicketType that indicates the type of ticket that contains the property.
  • propName[C++]
    [in] A BSTR that contains the name of the property to retrieve.
  • propName[Visual Basic]
    [in] A String that contains the name of the property to retrieve.
  • PVarCustomPropVal [C++]
    [out, retval] A pointer to a VARIANT containing a BSTR with the value for the specified property in the current user ticket. If the property is not found, the pointer is set to NULL.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If this method completes successfully, it returns a Variant that contains the value for the specified property in the current user ticket. If the property is not found, the returned Variant is empty.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_UPM_AUTHID_INVALID_PROPERTY [C++] 0xC1004C27

[Visual Basic] &HC1004C27

Invalid custom property name or value.
E_UPM_AUTHMANAGER_API_ASP_ONLY [C++] 0xC1004C24

[Visual Basic] &HC1004C24

This method should only be called within an ASP page.
E_UPM_AUTHMANAGER_TICKET_NOT_SET [C++] 0xC1004C25

[Visual Basic] &HC1004C25

Requested ticket not set.
MSG_UPM_AUTH_PROPNOTFOUND_ERROR [C++] 0xC1004C00

[Visual Basic] &HC1004C00

Requested property does not exist on the ticket.

[C++] Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

The following table defines the possible values for the EnumMSCS_TicketType.

Name Value Description
enumMSCS_ProfileTicketType 1 A MSCSProfile ticket used for an anonymous user.
enumMSCS_AuthTicketType 2 A MSCSAuth ticket used for a registered user.

Use the SetProperty method to place custom property values in the current user ticket.

[C++]

The pVarCustomPropVal parameter contains valid data only if the method completes successfully.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

' sPasswordValue is a String
' oAuthManager is a Commerce AuthManager object

sPasswordValue = oAuthManager.GetProperty(enumMSCS_AuthTicketType, _
 "Password")

See Also

[C++]AuthManager Object

[C++]IMSCSAuthManager::SetProperty

[Visual Basic]AuthManager Object

[Visual Basic]AuthManager.SetProperty

Copyright © 2005 Microsoft Corporation.
All rights reserved.