Library SimpleDNSResolver

[ Keywords | Classes | Data | Functions ]

Quick Index


Classes

CSimpleDNSClient
COM (ActiveX) object implementing ISimpleDNSClient, a DNS resolver.

Back to the top of SimpleDNSResolver

Data

Back to the top of SimpleDNSResolver

Global Functions

LPTSTR WindowsGetErrorText(DWORD dwErrorCode, LPTSTR lpszBuf, DWORD dwSize);
DWORD WindowsSocketGetErrorText(DWORD dwErrorCode, LPTSTR *lplpszTemp);

Back to the top of SimpleDNSResolver

#include "SimpleDNSClient.h"

CSimpleDNSClient

/* -----------------------------------------------------------------

Back to the top of SimpleDNSResolver

LPTSTR WindowsGetErrorText(DWORD dwErrorCode, LPTSTR lpszBuf, DWORD dwSize);

#include "WindowsErrorText.h"

Purpose: return the text for a given Windows Error Code

Parameters:

in dwErrorCode
WIN32 error code (e.g. returned by "GetLastError")
in lpszBuf
buffer where the error text will be written
in dwSize
size of the buffer (maximum size for the error text)

Return value : LPTSTR = error text (points to lpszBuf)

Description : This function is a wrapper for many error-handling functions from WIN32. It searches for error text in the following locations:

bulletIn the Operating System, using function FormatMessage (...FORMAT_MESSAGE_FROM_SYSTEM...)
bulletIn an hard-coded table for Windows Socket (Winsock) error code (see function WindowsSocketGetErrorText())
bulletIn specific modules, using function FormatMessage (...FORMAT_MESSAGE_FROM_HMODULE...):
bulletwininet.dll (Win32 Internet Errors)
bulletmqutil.dll (Microsoft Message Queue Errors)
bulletIn Extended Internet Errors, using function InternetGetLastResponseInfo()

If no error text is found, this function still builds an error message with the format "Error Code 0x%X (%d)" (the error code is shown is hexadecimal and in decimal).

LPTSTR WindowsGetErrorText(DWORD dwErrorCode, LPTSTR lpszBuf, DWORD dwSize);

Back to the top of SimpleDNSResolver

DWORD WindowsSocketGetErrorText(DWORD dwErrorCode, LPTSTR *lplpszTemp);

#include "WindowsErrorText.h"

Purpose: return the clear-text message for a Windows Socket (winsock) error code.

Parameters:

in dwErrorCode
winsock error code (should be above WSABASEERR = 10000)
out lplpszTemp
clear-text error message

Return value : DWORD = length of the error message, or 0 if the error code cannot be mapped (not a Winsock error code).

Description : Winsock error codes cannot be correctly mapped to clear-text messages using WIN32 function FormatMessage (try it; you'll be surprised). This function uses an hard-coded table to map code to their real clear-text messages.

The calling application must free the string allocated in variable lplpszTemp (using WIN32 function LocalFree()).

DWORD WindowsSocketGetErrorText(DWORD dwErrorCode, LPTSTR *lplpszTemp);

Back to the top of SimpleDNSResolver

Generated from source by the Cocoon utilities on Wed Feb 09 17:55:46 2000 .

Report problems to jkotula@stratasys.com