FVSDK_ERROR_CODE FVSDK_GetWelcomeMessage(FVSDK_Session* pSession, UINT nIndex, char* pszBuffer, int nBufferSize);
Fills pszBuffer with a NULL terminated string containing the requested line of the FTP server's welcome message. FTP responses can consist of multiple lines of text.
nIndex
The zero-based index of the requested line of the welcome message string. If nIndex is out of range, FVSDK_GetWelcomeMessage() returns FVSDK_NO.
pszBuffer
A pointer to a buffer that will receive the null terminated string containing the welcome message from the server. pszBuffer will be filled with the string up to the length of (nBufferSize - 1). This function will always ensure pszBuffer is a NULL terminated string.
nBufferSize
The size of pszBuffer in bytes.
FVSDK_OK if nIndex is a valid index into the welcome message string; FVSDK_NO, if not. Error codes can be found in FVSDK_ErrorCodes.h.
// buffer for getting the welcome message
char pszBuffer[128];
int nIndex = 0;
CString sWelcomeMessage;
// get the welcome message sent by the server when we connected
while (FVSDK_GetWelcomeMessage(pSession, nIndex++, pszBuffer, sizeof(pszBuffer)) == FVSDK_OK) {
// add the welcome message string to the message string
sWelcomeMessage += pszBuffer;
// add a <CR><LF> for formatting
sWelcomeMessage += "\r\n";
} // while
// show the last full welcome message in a message box
AfxMessageBox(sWelcomeMessage, (MB_ICONINFORMATION | MB_OK));