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. ATL / WTL / STL
  4. where is the mistake here?

where is the mistake here?

Scheduled Pinned Locked Moved ATL / WTL / STL
comhelpquestion
2 Posts 2 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.
  • R Offline
    R Offline
    rindam
    wrote on last edited by
    #1

    TCHAR buffer [16384]; DWORD bufferSize = sizeof(buffer)/sizeof(buffer[0]); BOOL bRes = InternetGetCookie(("http://www.codeproject.com"), NULL, (LPWSTR)buffer, &bufferSize); DWORD ret; if(bRes==FALSE) { ret = ::GetLastError(); CString str; str.Format(_T("%d"),ret); MessageBox(NULL,str,NULL,MB_OK); MessageBox(NULL,_T("no items1"),NULL,MB_OK); if (ret == ERROR_NO_MORE_ITEMS) MessageBox(NULL,_T("no items"),NULL,MB_OK); else if(ret == ERROR_INSUFFICIENT_BUFFER) MessageBox(NULL,_T("insufficient buffer"),NULL,MB_OK); else if(ret == ERROR_INVALID_PARAMETER) MessageBox(NULL,_T("invalid parameters"),NULL,MB_OK); } else { MessageBox(NULL,buffer,NULL,MB_OK); } This code is displaying garbage value for buffer.But I need the cookie value.what to do?

    L 1 Reply Last reply
    0
    • R rindam

      TCHAR buffer [16384]; DWORD bufferSize = sizeof(buffer)/sizeof(buffer[0]); BOOL bRes = InternetGetCookie(("http://www.codeproject.com"), NULL, (LPWSTR)buffer, &bufferSize); DWORD ret; if(bRes==FALSE) { ret = ::GetLastError(); CString str; str.Format(_T("%d"),ret); MessageBox(NULL,str,NULL,MB_OK); MessageBox(NULL,_T("no items1"),NULL,MB_OK); if (ret == ERROR_NO_MORE_ITEMS) MessageBox(NULL,_T("no items"),NULL,MB_OK); else if(ret == ERROR_INSUFFICIENT_BUFFER) MessageBox(NULL,_T("insufficient buffer"),NULL,MB_OK); else if(ret == ERROR_INVALID_PARAMETER) MessageBox(NULL,_T("invalid parameters"),NULL,MB_OK); } else { MessageBox(NULL,buffer,NULL,MB_OK); } This code is displaying garbage value for buffer.But I need the cookie value.what to do?

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      rindam wrote:

      what to do?

      First, stop posting your question multiple times. Second, a previous reply already told you the data is encoded and gave you a link to read. If you want to develop software I suggest you stop typing questions into forums and start reading the documentation that is relevant to your task.

      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