IMSCSAuthManager2::Initialize Method [C++]

Use this method to initialize the AuthManager object.

Definition

[C++]

HRESULT IMSCSAuthManager::Initialize(BSTRbstrSiteName,
);

[Visual Basic]

Sub Initialize(bstrSiteName As String)

Parameters

  • bstrSiteName[C++]
    [in] A BSTR that contains the name of the Commerce Server 2002 Web site.
  • bstrSiteName[Visual Basic]
    [in] A String that contains the name of the Commerce Server 2002 Web site.

[C++]

Return Values

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

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. 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] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. 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 AuthManager object must be properly initialized to a valid site name immediately after creating the object and before any other AuthManager object method is used.

The first time any AuthManager object uses this method, it connects to the Administration database and caches the site configuration data using the SiteConfig object. When subsequent AuthManager objects call this method the data is read from the cache.

Use the Refresh method to update the site configuration data after any of the properties have been changed.

Use the UnInitialize method to delete the site-specific configuration resource properties from the cache when the site is no longer valid.

It is suggested that you instantiate and initialize the AuthManager object in the Global.asa file to make sure at least one instance of the object exists, and to ensure the dynamic-link library (DLL) is loaded in memory and not flushed out by Internet Information Services (IIS) for performance reasons. This AuthManager object should not be used elsewhere. A separate instance of the AuthManager object must be created and destroyed on each ASP page.

This method is available when the MSCSAuthManager object is instantiated outside of the context of an ASP script.

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

[Visual Basic]

Example

' oAuthManager is a Commerce AuthManager object

oAuthManager.Initialize(sSiteName)

See Also

[C++]AuthManager Object

[Visual Basic]AuthManager Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.