так там же все вроде правильно —
m_hInternet = ::InternetOpen(
lpszAgent,
INTERNET_OPEN_TYPE_PRECONFIG,
NULL,
NULL,
0);
т.е. взять все настройки из реестра (т.е. надо думать из настроек IE), прокси там прописан, а пароль IE потом переспрашивает.
Ну вот, из коммандировки вернулся, можно продолжить :-)
Итак, куда подставить-то?
HINTERNET InternetOpen(
IN LPCSTR lpszAgent,
IN DWORD dwAccessType,
IN LPCSTR lpszProxyName,
IN LPCSTR lpszProxyBypass,
IN DWORD dwFlags
);
...
lpszProxyName
Address of a string that contains the name of the proxy server (or servers) to use if proxy access was specified. If this parameter is NULL, the function reads proxy information from the registry...
lpszProxyBypass
Address of an optional list of host names or IP addresses, or both, that should not be routed through the proxy.
... If this parameter is NULL, the function reads the bypass list from the registry.
Имеем имя прокси и список хостов, на которые надо ходить мимо прокси.
Это я в попыхах видимо отвечал, сам не очень разобрался что к чему, сори.
Ищи в MSDN статью "HOWTO: How to Handle Proxy Authorization with WinInet"
Я у себя проверить это дело не могу, если у тебя будет всё ok, давай подработаем класс и вставим это дело в статью. Там как-то можно определить требуется авторизация или нет.
Объясните пожалуйсто кто-нибудь назначение последнего параметра
функции internetconnect, и смысл значения 1u. В msdn возможные значения не
описаны, а смысл вложенный в описание понять не могу.
dwContext
[in] Pointer to a variable that contains an application-defined value that is used to identify the application context for the returned handle in callbacks.