| |
 |
SWAPI_ContinentCodeToContinentID
This function obtains the continent ID by its code.
Syntax
| Microsoft Visual C++ |
UCHAR __stdcall SWAPI_ContinentCodeToContinentID ( PCHAR ContinentCode ); |
|
| Borland Delphi |
function SWAPI_ContinentCodeToContinentID( const ContinentCode: PChar ): Byte; stdcall; |
|
| Microsoft Visual Basic |
Declare Function SWAPI_ContinentCodeToContinentID Lib "swapimap.dll" ( ByVal ContinentCode As String ) As Byte |
|
Parameters
| ContinentCode |
| [in] Pointer to a null-terminated string that contains the continent code. |
Return Value
If the function succeeds, the return value is a non-zero continent ID.
If the function fails, the return value is zero.
Sample Code
| Microsoft Visual C++ |
UCHAR ContinentID; CString ContinentCode, ContinentName; LPSTR pStr;
ContinentCode = "NA"; ContinentID = SWAPI_ContinentCodeToContinentID(ContinentCode); if (ContinentID == 0) { ContinentName = "Unknown"; } else { pStr = ContinentName.GetBuffer(13); pStr[SWAPI_ContinentIDToContinentName(ContinentID, pStr, 13)] = 0; ContinentName.ReleaseBuffer(); } AfxMessageBox(ContinentName); |
|
| Borland Delphi |
var ContinentID: Byte; ContinentCode, ContinentName: string; begin ContinentCode := 'NA'; ContinentID := SWAPI_ContinentCodeToContinentID(Pointer(ContinentCode)); if (ContinentID = 0) then ContinentName := 'Unknown' else begin SetLength(ContinentName, 13); SetLength(ContinentName, SWAPI_ContinentIDToContinentName(ContinentID, Pointer(ContinentName), 13)); end; ShowMessage(ContinentName); end; |
|
| Microsoft Visual Basic |
Dim res As String * 13 ContinentCode = "NA" ContinentID = SWAPI_ContinentCodeToContinentID(ContinentCode) if (ContinentID = 0) then ContinentName = "Unknown" else i = SWAPI_ContinentIDToContinentName(ContinentID, res, 13) ContinentName = Mid$(res, 1, i) End if MsgBox(ContinentName) |
|
Defined In
| Microsoft Visual C++ |
| SWAPIMap.h, SWAPIMap.cpp |
|
| Borland Delphi |
| SWAPIMap.pas |
|
| Microsoft Visual Basic |
| SWAPIMap.bas |
|
See Also
SWAPI_CountryIDToContinentID
Copyright © 2006-2008, TamoSoft
|