IAppCfg::GetRegionNamesListFromCountryCode Method
Use this method to retrieve an alphabetical list of state/province names associated with a specified country/region code.
HRESULT IAppCfg::GetRegionNamesListFromCountryCode(
BSTR bstrCountryCode,
ISimpleList** pplistRegionNames
);
Function GetRegionNamesListFromCountryCode(
bstrCountryCode As String
) As Object
Parameters
bstrCountryCode
[C++][in] A BSTR that contains the code of the country/region for which a list of state/province names is being requested.
[Visual Basic]
A String that contains the code of the country/region for which a list of state/province names is being requested.
pplistRegionNames
[C++][out, retval] The address of a pointer used to return an ISimpleList interface pointer. Upon successful completion, the list contains an alphabetical list of state/province names associated with the specified country/region code.
[Visual Basic]
Not applicable.
Return Value
[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 reference to a SimpleList object that contains an alphabetical list of state/province names associated with the specified country/region code.
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
[C++] The pplistRegionNames parameter contains valid data only if the method returns successfully.
You can set country/region codes and country/region names by using the Commerce Server Marketing Manager.
Example
' oAppCfg is a AppConfig object.
' listRegions is a SimpleList object.
Set listRegions = oAppConfig.GetRegionNamesListFromCountryCode("us")
For Each sRegion In listRegions
Response.Write sRegion
Next