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. Writing Http msgs to LOG file

Writing Http msgs to LOG file

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 Posts 3 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.
  • A Offline
    A Offline
    aman2006
    wrote on last edited by
    #1

    Hi I know how to assign the window for the status of messages in Http request as: CHttpSession *pHttpSession; pWnd = GetDlgItem(IDC_EDIT_RESPONSE); pHttpSession->SetStatusWnd(pWnd); How can write these messages into a LOG file instead to a window? Any suggestion please. I have to insert all the messages from Http to the Log file. Thanks in advance Shailesh

    E J 2 Replies Last reply
    0
    • A aman2006

      Hi I know how to assign the window for the status of messages in Http request as: CHttpSession *pHttpSession; pWnd = GetDlgItem(IDC_EDIT_RESPONSE); pHttpSession->SetStatusWnd(pWnd); How can write these messages into a LOG file instead to a window? Any suggestion please. I have to insert all the messages from Http to the Log file. Thanks in advance Shailesh

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      Can u get the content of the edit control? if so, just simpy write it to log file using CFile class << >>

      A 1 Reply Last reply
      0
      • E enjoycrack

        Can u get the content of the edit control? if so, just simpy write it to log file using CFile class << >>

        A Offline
        A Offline
        aman2006
        wrote on last edited by
        #3

        no Edit control does not exist in the picture Any more suggestion shailesh

        1 Reply Last reply
        0
        • A aman2006

          Hi I know how to assign the window for the status of messages in Http request as: CHttpSession *pHttpSession; pWnd = GetDlgItem(IDC_EDIT_RESPONSE); pHttpSession->SetStatusWnd(pWnd); How can write these messages into a LOG file instead to a window? Any suggestion please. I have to insert all the messages from Http to the Log file. Thanks in advance Shailesh

          J Offline
          J Offline
          Jose Lamas Rios
          wrote on last edited by
          #4

          Couldn't find CHttpSession neither in the documentation nor in the MFC include/source files. I only have VS2005 in this machine; maybe this class was in VC98 and was later removed from MFC? I'll check in a VC98 installation I have in another computer but that won't be until tomorrow. Meanwhile, I'm guessing CHttpSession is/was a class derived from CInternetSession. Am I right? If so, check your MFC source files to see what use CHttpSession makes of the window you pass in SetStatusWnd. My guess is that the window is being used in CHttpSession's implementation of OnStatusCallback (i.e., constructing a message text based on the callback parameters and then simply calling SetWindowText on the window). You might create your own class derived from CHttpSession and override OnStatusCallback in such a way that the messages are written to a log file. Other than that, you might also create a derived CWnd class to be used as the status window. You can make that window not visible (i.e., ShowWindow(SW_HIDE); ) but trap all WM_SETTEXT messages to redirect the text to your log file. Hope that helps, -- jlr http://jlamas.blogspot.com/[^]

          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