Writing Http msgs to LOG file
-
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
-
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
Can u get the content of the edit control? if so, just simpy write it to log file using CFile class << >>
-
Can u get the content of the edit control? if so, just simpy write it to log file using CFile class << >>
-
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
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/[^]