|
That depends... is IE or Netscape written in C++?
|
|
|
|
|
Anonymous wrote:
That depends... is IE or Netscape written in C++?
What???
Do you think that will help to answer my question?
Carlos
p.s. both IE/Netscape are written in C/C++
|
|
|
|
|
you asked ... "Is it possible to run a CGI program in a web server from a C++ client application?"
IE/Netscape are client applications that send request to web servers. Sometimes these request result in the web server executing a CGI. So I guess maybe that the answer to your question is YES.
|
|
|
|
|
Yep, you're right, my question was not very clear
I should have written, how can I run a CGI program in a Web server from my C++ application? In other words, how can I send a POST/GET command from my app to a CGI-bin program?
Hope that makes sense now.
Thanks,
Carlos
|
|
|
|
|
IIRC, You can simulate POST by running the program, and dumping the data stream into its text input stream, and for GET you use some environment variable instead.
It was years ago I did any CGI stuff, that's all I can remember, so YMMV.
--
Ian Darling
If I was any more loopy, I'd be infinite.
|
|
|
|
|
There are a lot of ways to do it. You can open a socket and implement the (relatively simple) HTTP protocol to send the raw bytes for a GET or POST and interpret the results. Or you can use an existing HTTP implementation in a library or the WinInet functions in the Windows API. Look in MSDN for HttpOpenRequest
|
|
|
|
|
yes, all you need is connect to your target server on port 80, and give it a post or get request.
Use sockets.
when you connect to the machine on 80,
send data on the socket like this ..
GET /yourfolder/yourfile.cgi HTTP/1.0\n
User-Agent: Cool Browser 3.3\n
Host: www.yourmachinehere.com\n
Accept: */*\n
After you send that on the socket, your response will look like
'
HTTP/1.0 good request
some other stuff...
then it will send you the output (cgis output, or requested file if you get htmls/ images etc. )
'
sockets, and http protocol man. i dont remember the post syntax or id write it here too, just google the http rfc's for reference.
todo....
:: insert inpirational text here ::
|
|
|
|
|
Can anybody give me some useful advise on this problem I am having? Here's the code that is blowing up.
BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
if (!m_wndMainSplitter.CreateStatic(this, 2, 1, WS_CHILD | WS_VISIBLE))
{
TRACE("Failed to CreateStaticSplitter\n");
return FALSE;
}
cout << "DEBUG 1 WooHoo I got this far!" << endl;
// First main splitter pane
if (!m_wndMainSplitter.CreateView(0, 0, RUNTIME_CLASS(CCube_IView),CSize(300,300), pContext))
{
TRACE("Failed to create top view pane\n");
return FALSE;
}
// The code doesn't get this far!
/*
* Debug Assertion Failed!
* Program : blah
* File: winsplit.cpp
* Line: 364
*/
cout << "DEBUG 2" << endl;
....
|
|
|
|
|
I haven't checked my splitter code - but putting streams (cout) in there might screw it up.
|
|
|
|
|
- Run the program under the debugger;
- Wait for the assertion message box to appear;
- Hit Retry;
- Inspect the call stack to see how pView ended up being NULL
I mention those steps because it looks like you're trying to debug by inspecting console output. That rarely works. Instead, use the power of the debugger - inspect variables, step into suspect code, experiment.
|
|
|
|
|
Hi, I have ListView that shows files on local drives and want to let user select view mode. So application starts defaultly with ListView set to LVS_REPORT and when user selects another style of view, the proper style is set using following code:
ModifyStyle(LVS_TYPEMASK,(LVS_ICON & LVS_TYPEMASK));
Or with LVS_SMALLICON instead of LVS_ICON when user wants to show large icons, of course.
In report style everything is ok. But when I switch to LVS_ICON mode, it looks like on this picture (I took a screenshot of my ListView):
ListView in LVS_ICON mode
And, when I switch to LVS_SMALLICON mode, it looks like this:
ListView in LVS_SMALLICON mode
As you can see, first row is missing (but when I for example double click on that empty space, my program handles it correctly as the items would be there.
I must also mention that the ListView I use has Custom Draw feature (so I handle OnCustomDraw()) and it is Virtual ListView (so I handle OnGetDispInfo()).
I'm really out of my knowledge...
Thank you for any suggestion!
|
|
|
|
|
Hi i am wondering how to work the scroll bars in a dialog box that were enabled through the dialog editor by selecting horizontal scroll and vscroll
i cant figure out how becuase i cant edit thier properties with the dialog editor is there some special way to acess these?
|
|
|
|
|
hi,ive just started to use visual c++,and there was a sample in the MSDN library called drawcl, it iIllustrates Integrating Active Container Support with Application-Specific Features.i wanted to know how i could put text on the canvas at a position that the user want.thx
|
|
|
|
|
There are several solutions. One solution is DrawText(). Another solution is TextOut().
Kuphryn
|
|
|
|
|
Hello,
I was wondering if anyone had a good idea on how to convert the following...
CString strN;
strN.Format("%d", nNum); // where nNum is something like 1123456
I would like to see the output of strN equal "1,123,456"
Is there a easy way to do this?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Someone mentioned the API GetNumberFormat a few days ago. It's the fancy way of doing it. I'm sure you can whip up a quick for loop that will do it just as well.
Regards,
Alvaro
Hey! It compiles! Ship it.
|
|
|
|
|
Why don t u just put a comma after the third, the sixth... char?
Just make a loop which every 3 char inserts
a comma with CString::Insert for instance.
Something like this:
for(i,from begining to the end of the cstring)
{
if(i==3or6or9)
urstring.insert(",") //not the good syntax but u get the idea across
}
Is it what u meant?
hope it s of any help 2 u.
syl
sysy
|
|
|
|
|
Hi,
In the tree control at the time of inserting an item I put an application specific CString data with it as following:
m_TreeCtrl.SetItemData (hItem, (DWORD) ("Hello"));
But, if I try to use GetItemData the following way, the conversion gives error. Please let me know how I can convert a DWORD into a CString:
DWORD selelection = m_TreeCtrl.GetItemData (hItem);
CString str = (CString) selelection ;
|
|
|
|
|
Binayak wrote:
m_TreeCtrl.SetItemData (hItem, (DWORD) ("Hello"));
First off you will have to understand the a string, is not a number, so it cannot be converted to a DWORD!
Now, SetItemData associates the tree node with a DWORD (unsigned long, methinks); it does not an object class, or a string array.
Now as it happens, you can use the DWORD value as a pointer to an object, which in your case would probably be a string resource (or dynamically created array, if the string is unknown at the time).
-----
TCHAR* czStringArray[]={"Hello","Old","Boy"};
..
m_TreeCtrl.SetItemData(hItem, (DWORD)0);
..
..
DWORD nIndex = m_TreeCtrl.GetItemData(hItem);
CString strAssociatedString = czStringArray[nIndex];
cout<<(LPCTSTR)strAssociatedString<<endl;
you could also do the same with pointers to string values as well.
I Dream of Absolute Zero
|
|
|
|
|
Hi!
Using the winsock functions I am trying to make a chat program...
I have a server program and a client program but my server can only handle one client at a time! (I have blocking mode connection)
How can I handle multiple clients?
Thank you very much for your future answers!
Well... I am a beginner ...
|
|
|
|
|
There are several solutions. In theory and in practice, supporting multiple sockets using blocking I/O is quite unusual. In general, one solution is to keep track of all clients using a map.
I recommend an OVERLAPPED I/O model or IOCP.
Kuphryn
|
|
|
|
|
Hi, all:
I have a weird problem and need your help. I have a main app and DLL. In the main app I have my object pointer (CMyObj* pObj) that has method like:
HRESULT TranslateIDToName( long lID, LPSTR cBuff, UNIT dwBuffSize );
this TranslateIDToName then calls some methods in DLL.
In main, I have something like this:
const DWORD dwBuffSize = 128;
TCHAR cBuff[dwBuffSize];
pObj->TranslateIDToName( lID, cBuff, dwBuffSize );
When I compile both main app and DLL in RELEASE, (both uses Multithreaded DLL as Runtime DLL ). It works fine! However, if I compile both in Debug ( both uses Debug Multithreaded DLL ), I step through the code, The TranslateIDToName() fills up the cBuff correctly and then return from the function.
The problem comes when the function returns to the caller:
pObj->TranslateIDToName( lID, cBuff, dwBuffSize );
The pObj is trashed with either garbage in the pObj or pObj = NULL. In either case, the pObj address changes before calling the method and right after return from the method ( the Stack really messed up!!). Of course, the app crashes!
I tried all the stuff I can think of, and no more ideas about what could be wrong.
Any suggestion and help will be highly appreciated. Thanks in advance.
Dion
|
|
|
|
|
What goes on inside of TranslateIDToName()?
Kuphryn
|
|
|
|
|
I got the problem fixed. the problem is the array index out of range inside the function. thanks anyway.
|
|
|
|
|
Recently I've spotted the download manager "Hidownload" (www.hidownload.com),
and I'm wondering how they're analyzing the web-traffic.
They're catching url's to streamed RealMedia files, WMV files etc.
Now I know how to get download URL's from IE etc.,
but they seem to be doing it on a very low level.
(You have to specify which network-card you want to monitor.)
Does anyone have a clue how to do this ?
|
|
|
|