|
Hi!
I'm trying to write my own HTTP server in Win32API, with the Winsocks API.
For the moment, it can read the GET and HEAD methods, so I can handle basic HTML and JavaScripts which don't tell data to the server.
To to this, I would like to use the POST method, but I don't know how to use it.
It would be great if you could send me documentation about POST and other specifications about HTTP methos (with samples if possible)
Thanks !
Time doesn't waits
|
|
|
|
|
You can go through the HTTP RFC's[^]
As far as I know... GET appends the data (Form fields) to the URL (as in xyz.html?s=y... etc)
POST appends the fieldname and value to the end of the request data... so look for (\n\n) and see if you have any fields.
I hope this helps
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Hai,
I'm creating a dialog-based app in win32 vc++. After starting the app,if there is no user activity for 10 sec the app should exit...Can anyone suggest how to do this.
thanks.
|
|
|
|
|
Use a timer to increment a counter every second, when the counter hits 10 call EndDialog. At the same time have every possible user input action reset the counter to 0.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
cse WM_INITDIALOG:
SetTimer();
break
case WM_TIMER:
EndDialog();
break;
And when a button is pressed the timer should pe set again or whatever you want tpo do
gabby
|
|
|
|
|
Sorry to take up for forum space here!
Many thanks for your time and may the force be with you! (you'll need it!)
|
|
|
|
|
If it is just a regular C/C++ question, this forum will do fine. If it is a question regarding managed extensions and the .Net runtime then use the Managed C++ forum[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Forget it, I have just woke up!
Many thanks for your time and may the force be with you! (you'll need it!)
|
|
|
|
|
Is there any way to turn off warnings for visual studio headers while still keeping a high warning level on your project code? I looked briefly in the forums but couldn't find anything that specifically applies.
|
|
|
|
|
Use the #pragma warning directives.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
You can also modify the warning level for particular source files, if there is one that causes you consternation. I often do this when dealing with 3rd party files that I have no control over.
|
|
|
|
|
I use warning level 4, and don't see warnings out of the 'visual studio headers'. What kind of warnings are you seeing, and which compiler (VC6, VS.NET 2002, VS.NET 2003) are you using?
Software Zen: delete this;
|
|
|
|
|
Sorry, I guess I wasn't specific enough. VC6 compiler. The warnings are usually like this;
c:\program files\microsoft visual studio\vc98\include\xmemory(39) : warning C4100: '_P' : unreferenced formal parameter<br />
c:\program files\microsoft visual studio\vc98\include\xmemory(41) : warning C4100: '_P' : unreferenced formal parameter<br />
c:\program files\microsoft visual studio\vc98\include\vector(249) : warning C4663: C++ language change: to explicitly specialize class template 'vector' use the following syntax:<br />
template<> class vector<bool,class std::allocator<unsigned int> > ...
I'm also getting alot of signed/unsigned mismatches and casting warnings. It's ok though, I just modified the offending files with pragma
directive and everything seems to be working fine.
Thanks!
Brent
|
|
|
|
|
I have a MDI application with a customized toolbar. This toolbar has up to 4 edit boxes (command profile configurable) that get updated and provide feedback of geo-coordinates(MTM, UTM, Lat/Long,etc). I have noticed that my toolbar works fine until I add another toolbar to the app. The other toolbars are not dynamic in nature like the coordinate toolbar, so it really shouldn't hit the performance of the coordinate toolbar's editbox updates, but it does. The update of the coordinate toolbar's editboxes are driven by mouse movements(OnMouseMove). Any ideas? Thanks!
|
|
|
|
|
OnUpdate handlers are called for each toolbar button during idle processing etc. You need to keep the amount of time each handler spends doing whatever it does to a minimum.
If your the calc's for your edit boxes take too long you will see sluggish performance. Mousemoves can be sent with the same coordinates as the previous call. You should check if they've changed and if not do zip.
Also look at profiling your code. I personally like Glowcode www.glowcode.com[^]
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Looks okay.
Does it initialize if the calls to AddString() were commented out?
Kuphryn
|
|
|
|
|
Yes, outcommented works fine!
my problem is really the combo initialisation.
Filippo
|
|
|
|
|
The call to UpdateData() is unnecessary.
filo65 wrote:
Does anyone have a suggestion??
Have you looked at line 186 of WinCtrl1.cpp? It clearly tells you what the problem is. You have specified the combobox as owner-draw, yet not implemented the three virtual methods.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thank you and sorry for the delay in answering but a wife, three kids and a dog keep life busy.
Filippo
|
|
|
|
|
I'm right there with ya, but in lieu of a third kid, I've got a 10-acre farm! We've a cat, too, but he is low maintenance.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I have some trouble initialising a CComboBox (IDC_COMBO, Control, m_Combo) in a Modeless dialog (IDD_MODE) called by a menu item via OnModelss Function.
in my appView.cpp i added the following code
void CAppView::OnModeless()
{
CModeless* dlg = new CModeless();
dlg->Create(dlg->IDD,NULL);
dlg->ShowWindow(SW_SHOWNORMAL);
}
// Modeless.h : Header
#if !defined(AFX_MODELESS_H__520EAA74_A5F9_4AEC_AA59_F87866452E43__INCLUDED_)
#define AFX_MODELESS_H__520EAA74_A5F9_4AEC_AA59_F87866452E43__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CModeless.h : Header
//
/////////////////////////////////////////////////////////////////////////////
// Dialogfeld CModeless
class CModeless : public CDialog
{
DECLARE_DYNAMIC(CModeless)
public:
public:
CModeless(CWnd* pParent = NULL);
BOOL Create(UINT nID, CWnd* pWnd)
{ return CDialog::Create(nID,pWnd); }
void PostNcDestroy()
{ delete this; }
void OnCancel()
{ DestroyWindow(); }
///////////////////////////////////////////
virtual ~CModeless();
//{{AFX_DATA(CModeless)
enum { IDD = IDD_MODE };
CComboBox m_Combo;
//}}AFX_DATA
//{{AFX_VIRTUAL(CModeless)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CModeless)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
#endif // AFX_MODELESS_H__520EAA74_A5F9_4AEC_AA59_F87866452E43__INCLUDED_
// Modeless.cpp//
#include "stdafx.h"
#include "App.h"
#include "CModeless.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNAMIC(CModeless, CDialog)
CModeless::CModeless(CWnd* pParent /*=NULL*/)
: CDialog(CModeless::IDD, pParent)
{
//{{AFX_DATA_INIT(CModeless)
//}}AFX_DATA_INIT
}
void CModeless::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CModeless)
DDX_Control(pDX, IDC_COMBO, m_Combo);
//}}AFX_DATA_MAP
}
CModeless::~CModeless()
{
}
BEGIN_MESSAGE_MAP(CModeless, CDialog)
//{{AFX_MSG_MAP(CModeless)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
BOOL CModeless::OnInitDialog()
{
CDialog::OnInitDialog();
m_Combo.AddString("1"); !!!!!!!!!!!!!! HERE I get a Debug Assertion Failed error
m_Combo.AddString("2"); winctrl1.cpp, line 186
m_Combo.AddString("3");
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
}
Does anyone have a suggestion??
Thanks and Regards
Filippo
|
|
|
|
|
Is there a way to detect when Windows raises a Warning Message? For example, let's say an app has memory error and it raises an assertion message. Can this message's handle be grabbed then a response to the message be passed along? Thanks.
|
|
|
|
|
Have you looked at the ASSERT() macro? When an assertion is fired (exceptions are raised), it simply produces a message box with the filename and line number of the offending statement. No WM_xxx message has been sent/posted such that anything could be grabbed intercepted.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
But assertion still creates a window. Shouldn't we be able to grab it's handle and programatically click the OK button. How about using a FindWindow and then use the returned handle to SendMessage(..., BUTTON_CLK)? I'm not sure. That's why I'm posting the question.
|
|
|
|
|
Anonymous wrote:
But assertion still creates a window.
Right.
Anonymous wrote:
Shouldn't we be able to grab it's handle and programatically click the OK button.
Only if the dialog were modeless. Since it is a modal dialog, your application's message pump is blocked until that window is dismissed.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|