|
|
CHttpFile *s;
CHttpConnection *c;
CInternetSession *is;
if (useProxy)
is = new CInternetSession(NULL, 1, INTERNET_OPEN_TYPE_PROXY, ProxyURL);
else
is = new CInternetSession(NULL, 1, INTERNET_OPEN_TYPE_DIRECT);
c = is->GetHttpConnection("ip", (INTERNET_PORT) 4000);
wsprintf (param,"nickname=%s&password=%s&entranceRoom=%s",User,PassWd,RaumName);
wsprintf (length,"Content-Length: %d\r\n",strlen(param));
strcpy (header,hdrs2);
strcat (header,hdrs3);
strcat (header,hdrs4);
strcat (header,length);
strcat (header,hdrs5);
wsprintf(rline, "/Login.html");
s = c->OpenRequest("POST",rline,referer,0,NULL,"HTTP/1.1",INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD);
LPCTSTR lpszHeaders = header;
s->SendRequest(lpszHeaders, strlen(header), param, strlen(param));
f = new fstream("back.html", ios::out);
while (s->ReadString(l) != FALSE)
{
... // some *f things
}
delete f;
s->Close();
delete s;
delete c;
delete is;
this is only a little example from my code ... not even perfect but its working.
u always have to check ur headers and the things that you send.
best way to check is a html browser and a packet sniffer. there are many outta there. with the sniffer u see the original header and data. and could also check your program that it send also the right one.
bye
|
|
|
|
|
i have made a program that uses a file format that i have created called *.sts and i need to make the file (when double clicked) open my program and load the file in?
|
|
|
|
|
|
Hi,
I have created a CPropertySheet modal window, and I'd like to be able to remove the OK, Cancel, Apply Now, and Help buttons but don't know how.
Please help me
Fabian
|
|
|
|
|
found something, no more help needed
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q141039
|
|
|
|
|
Has anyone gotten this to work? I keep getting script errors.
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
Frankly AOL should stick to what it does best: Fooling millions of americans into believing that it, AOL, is the web. -Paul Watson
|
|
|
|
|
Consider the following 2 program code segments. Which one utilizes main memory more efficiently, and which one takes up more space in main memory for variables?
Code segment #1:
int score1, score2, score3;
.
.
Code segment #2:
int score[3];
.
.
Loli10
|
|
|
|
|
no difference in space. they will probably be allocated identically, too (three consecutive DWORDs)
-c
Smaller Animals Software, Inc.
You're the icing - on the cake - on the table - at my wake. Modest Mouse
|
|
|
|
|
Twice programs use the same memory size...
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Told ya so...
|
|
|
|
|
I asked the following question today in a MSDN chat:
Alice_MS : Q: soliant : Are there going to be tests targeting C++.Net in the future ?
Alice_MS : A: Yes, there will be some coming later this year.
Just an FYI.
Soliant
|
|
|
|
|
I am very new to C++ and I was wondering how to go about printing graphics to the screen even just simple dots circle and lines !!
Can anybody help me ?
|
|
|
|
|
Create a message handler for your WM_PAINT message in the window that you want to draw on.
Inside WM_PAINT add this code assuming hWnd is the handle to your window:
PAINTSTRUCT ps;
HDC hdc;
hdc = ::BeginPaint(hWnd, &ps);
There are a number of functions that you can use to paint on the HDC handle that you have just created, lookup "device context [win32]" in msdn.
You would add these functions here. Here is an example of how to paint two lines and a circle.
// Set the initial pen position for the pen that will draw the line. When you create the DC,
// the default position is at (0,0).
::MoveToEx(hdc, 100, 100, NULL);
// Draw a horizontal line from the current position (100,100) to (200,100).
::LineTo(hdc, 200, 100);
// Draw a line at 45 degrees current position (200,100) to (300,200).
::LineTo(hdc, 200, 100);
// Draw a circle. The circle function does not depend on the current pen position.
::Ellipse(hdc, 100, 100, 200, 200);
Finally, in order to free the DC that you have created with BeginPaint, you must call EndPaint.
::EndPaint(hWnd, &ps);
After reading your message again, I am not sure if you are asking how to paint to the desktop. If so, instead of using BeginPaint in order to create your DC, use this call:
hdc = CreateDC("DISPLAY", NULL, NULL, NULL);
or
hdc = GetDC(NULL);
In either case, this will only create a DC to the primary monitor. If you are programming for a computer with multi-monitor support you will need to use EnumDisplayMonitors to determine which dirver to create the DC for.
Then you will need to use this function to release the DC:
::DeleteDC(hdc);
or
::ReleaseDC(NULL);
Depending on which function you used to allocate the DC.
|
|
|
|
|
If you're using the console ( which is how you should learn C++ before moving to Windows specific stuff ), then there is no real way to show graphics. If you're using MFC, then stop it now. Learn the basics of C++, class design, OO, and the standard library before getting to the Microsoft specific stuff. You'll be glad you did.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
|
|
|
|
|
|
Nish [BusterBoy] wrote:
For once, CG didnt mention STL.
When I said 'the standard library', I was thinking of both STL and IOStreams.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
|
|
|
|
|
|
Hello!
I am trying to perform a wildcard delete in my MFC App. I am currently calling a DOS command, but this results in a flashing DOS window. Is there any way to accomplish this without opening a DOS window at all???
Mandy
|
|
|
|
|
You can use the FindFile API to locate the files you wish to delete, and then your choice of functions (unlink() , DeleteFile() , etc.) to perform the deletion.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
|
|
Hi Mandy,
The responses given so far will do the job, but it's always good to know your options, even if some are quick and dirty like this one:
::WinExec("del *.bak", SW_HIDE);
Regards,
Alvaro
A priest, a minister and a rabbi walk into a bar. The bartender says, "What is this, a joke?"
|
|
|
|
|
I have three CBitmapButton controls and I can't figure out what flags to specifiy in Create to allow all three buttons to hold their state independently of each other. Right now it appears they are grouped, when one is down the other two are up and so on. do OWNERDRAW buttons lose the ability to keep state? Do I create a GROUP button for buttons I want to be synchronized with each others up/down state? I'm not specifying WS_GROUP explicitly so I can't figure out why the buttons are acting like grouped buttons.
Anyone care to fill me in on how this is done???
I'm creating the controls at runtime in a CView so i'm NOT using the dialog editor.
TIA
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
HockeyDude wrote:
I'm not specifying WS_GROUP explicitly ...
I think that is actually the problem, WS_GROUP specifies the start of a group of controls. If you want each button to act seperately, then put each button in its own group.
|
|
|
|
|