Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help on WinInet Programming

Help on WinInet Programming

Scheduled Pinned Locked Moved C / C++ / MFC
csharphelpc++htmldatabase
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Girish601
    wrote on last edited by
    #1

    Hi Friends, I wanna some help on WinInet Programming. I am writing a VC++ client which is supposed to communicate a web Server written in C#.net. I am able to send a request to Web Server but how to read the contents send by WebServer can anybody help me in this ? Following is my code: HINTERNET hOpen,hConnect,hRequest; BOOL retval; DWORD dwErrorCode;//=12032; CString data="cmdCreateSessionID"; hOpen=InternetOpen("HttpApp/1.0", INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0); hConnect=InternetConnect(hOpen, SERVER_LAN_NAME,4000, NULL,NULL, INTERNET_SERVICE_HTTP,0,0); CString method="POST"; CString url="index.html"; DWORD dwFlags=0; hRequest=HttpOpenRequest(hConnect,method,url, NULL, NULL, NULL, dwFlags, 0); DWORD R1=GetLastError(); HttpSendRequest(hRequest,NULL,0,data.GetBuffer(), data.GetLength()); dwErrorCode = hRequest ? ERROR_SUCCESS : GetLastError(); CString lpBuffer; INTERNET_BUFFERS dwStruct; DWORD dwNumberOfBytesToRead,dwNumberOfBytesRead; dwNumberOfBytesRead=dwNumberOfBytesToRead=0; BOOL retReadFile=InternetReadFile(hRequest,&lpBuffer,dwNumberOfBytesToRead, &dwNumberOfBytesRead); In the InternetReadFile function i am unable to read any buffer. With Rgds VC++ Girish Software Developer

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups