Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

internet connectivity

5 views
Skip to first unread message

B K@discussions.microsoft.com ARUN B K

unread,
May 27, 2009, 4:03:02 AM5/27/09
to
Hi,
Iam trying to connect to windows through win 32 API my code is given below.

hSession = InternetOpen((LPCWSTR)"MSDN SurfBear",
PRE_CONFIG_INTERNET_ACCESS,
NULL,
INTERNET_INVALID_PORT_NUMBER,
0) ;
test = GetLastError();

// Connect to www.microsoft.com.
hConnect = InternetConnect(hSession, (LPCWSTR)"www.microsoft.com",
INTERNET_INVALID_PORT_NUMBER,
NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
test = GetLastError();

// Request the file /MSDN/MSDNINFO/ from the server.
hHttpFile = HttpOpenRequest(hConnect,
(LPCTSTR)"GET",
(LPCTSTR)"/MSDN/MSDNINFO/",
HTTP_VERSION,
NULL,
0,
//INTERNET_FLAG_DONT_CACHE,
INTERNET_FLAG_SECURE ,
0) ;

// Send the request.
bSendRequest = HttpSendRequest(hHttpFile, NULL, 0, 0, 0);

test = GetLastError();

bQuery = HttpQueryInfo(hHttpFile,
HTTP_QUERY_CONTENT_LENGTH,
bufQuery,
&dwLengthBufQuery,0) ;


test = GetLastError();

But HttpSendRequest is giving an error 12007.
I tried deactivating firewall also , but still the same problem
Please let me know if anyone have a solution to this problem?

Thanks ,
Arun

0 new messages