CTextMessage::EnumProviders Method  
 
INT EnumProviders(
  LPSMSPROVIDER lpProviders,  
  INT nMaxProviders,  
);

The EnumProviders method enumerates the supported wireless service providers and populates an array of SMSPROVIDER structures.

Parameters

lpProviders
A pointer to an array of SMSPROVIDER structures that will be populated with information about each service provider. If this parameter is NULL, the method will return the number of service providers that are known.
nMaxProviders
An integer value which specifies the maximum number of service providers that may be enumerated by this method. If this parameter is zero, the method will return the number of service providers that are known. If the lpProviders parameter is NULL, this value should be zero.

Return Value

If the method succeeds, the return value is the number of known service providers. If the method fails, the return value is SMS_ERROR. To get extended error information, call GetLastError. If the lpProviders parameter is not NULL and the nMaxProviders parameter indicates the array is not large enough to store all of the provider information, this method will fail with an error indicating that the buffer is too small.

Remarks

The EnumProviders method is used to enumerate all of the supported wireless service providers, populating an array of SMSPROVIDER structures that contains information about each provider, such as their name, domain, region of the country they service and the maximum message size they will accept. Typically this would be used to update a user interface control such as a listbox or drop-down combobox, enabling a user to select a preferred service provider.

The GetFirstProvider and GetNextProvider methods offer an alternative way to enumerate the available service providers.

To obtain information about a single service provider, use the GetProvider method.

Example

SMSPROVIDER smsProviders[MAXPROVIDERS];

INT nProviders = pTextMessage->EnumProviders(smsProviders, MAXPROVIDERS);
if (nProviders == SMS_ERROR)
{
    pTextMessage->ShowError();
}
else
{
    for (INT nIndex = 0; nIndex < nProviders; nIndex++)
        pComboBox->AddString(smsProviders[nIndex].szName));
}

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: cstxtv11.lib
Unicode: Implemented as Unicode and ANSI versions

See Also

GetFirstProvider, GetGateway, GetNextProvider, GetProvider, SMSPROVIDER