Re[3]: RasDial без использования телефонной книги
От: d-e-n  
Дата: 03.07.05 13:44
Оценка:
DEN>Уже грешу на работу RAS-а на тестовой машине, может у кого-нибудь есть возможность проверить работу приведенного кода на своей W98?
На всякий случай — полный код тестового проекта (консоль):

#define WINVER 0x400
#include <Windows.h>

#include <Ras.h>
#include <Raserror.h>
#pragma comment (lib, "Rasapi32.lib")

#include <stdio.h>
#include <conio.h>

int main(void) {
    RASDIALPARAMS RASDialParams;
    memset(&RASDialParams, 0, sizeof(RASDIALPARAMS));
    RASDialParams.dwSize = sizeof(RASDIALPARAMS);

    DWORD dRes;
    HRASCONN hRASConnHandler = NULL;

    _snprintf(RASDialParams.szPhoneNumber,  128, "121234");
    _snprintf(RASDialParams.szUserName,     256, "xxx");
    _snprintf(RASDialParams.szPassword,     256, "xxx");

    dRes = RasDial(NULL, NULL, &RASDialParams, 0, NULL, &hRASConnHandler);

    printf ("dRes = %i", dRes);
    getch();
    
    return 0;
}


Интересует поведение функции RasDial при параметре lpszPhonebook == NULL и при пустом поле структуры RASDialParams -szEntryName == ""

lpszPhonebook
[in] Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.
Windows 95: This parameter should always be NULL. Dial-up networking stores phone-book entries in the registry rather than in a phone-book file.


szEntryName
Specifies a string that contains the phone-book entry to use to establish the connection. An empty string ("") specifies a simple modem connection on the first available modem port, in which case a non-empty szPhoneNumber must be provided.
The callback number is no longer stored in the registry. Specifying an asterisk for szCallbackNumber causes RAS to return error 704: ERROR_BAD_CALLBACK_NUMBER.

Windows NT 3.51 or earlier, Windows Me/98/95: This member is not supported.

 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.