|
Use Poco C++. I used it before eventhough I personaly did not touch the network library of it. (consists of 3 dlls maybe you just need the network one only).
If I remember well there was a class called HttpClient so it will automatize your task.
There are test suites as well so you can figure how things are being used and even take your decision of whether to use the library or not.
http://pocoproject.org/
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
You need to study the rules of sockets. A recv() call will only return the amount of data that is currently available on the socket. You must continue to receive data until you get the end of the transmission (I cannot remember the last piece of an HTTP message, but I'm sure you can Google it). Don't just assume you will get the entire message in one go.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hello people.
I have a tooltip-like system that shows up information in a popup window based on where the mouse cursor points. Works fine most of the time, but when there's a message box or other modal dialog popping up because of certain events hapening in the background, the tooltip windows just stays on the screen. I guess this is because once the parent window containing the control that has the tooltips is deactivated/disabled (because of the modal dialog), it no longer receives any mouse messages thus the "tooltip" will think that the mouse is still pointing at the given location (since there's no WM_MOUSEMOVE, no WM_MOUSELEAVE...). I used the usual mouse messages (WM_MOUSEMOVE, WM_LBUTTONDOWN...) along with TrackMouseEvent[^] to know when and what to show and hide. But i don't know how to handle the case when we no longer receive any mouse input. One way i guess would be to handle WM_ACTIVATE in the parent window and then channel the event towards the child that has the tooltips but this seems to be quite a non-portable and ugly solution. So anyone knows how to do this right?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Hi there,
So what about just intercepting the event of when that parent window gets de-activated because of the pop-up and force to tooltip to disappear ?
You may thus look for WM_ACTIVATE event. Its handler gives a state parameter by which you know if your window is being activated or deactivated, and in the second case it can even give you the address of the "guilty" window (the popups in your case)
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
As i said, that is one option, it just seems a bit...ugly. Having to do that for every "parent" window everywhere you want to use this tooltip thing isn't convenient.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Sorry I looked to your message rapidly, not paying attentio,n to your last sentence.
Well, I do'nt thiink it is too ugly. By the way, you are already calling your tooltip from within the parent frame, in order to achieve things like the tooltip fades away when mouse leaves the control area, no ?
I honestly can't see something else. I had this pbm before with Pustovoy' tooltip when popus are triggered by hyperlinks on the tooltip themselves.
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
No, i use TrackMouseEvent[^] to detect when the mouse leaves. Guess i'll have to go with the activation "relaying" then. Thanks for your help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
void getPath(LPSTR lpszPath)
{
CFile file;
char pbuf[512];
...
file.Read(pbuf, size);
}
So what can I do to manage it?
Maybe what has confused me is the different string data types....
|
|
|
|
|
It is the same as if you were dealing with char* !
Have the habit of discovering what the definition of an unknwon type to you is. In this case you'll find it's just made from a typedef !
typedef CHAR *LPSTR;
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
|
LPSTR is a char*
typedef char* PSTR, *LPSTR;
|
|
|
|
|
|
#include "stdafx.h"
#include <iostream>
#include "afx.h"
using namespace::std;
void getPath(LPSTR lpszPath, int max)
{
char pbuf[512];
LPCTSTR lpszFileName = _T("1.txt");
CFile mFile(lpszFileName, CFile::modeRead | CFile::shareCompat);
if(mFile.GetLength() < 2)
return;
mFile.Read(pbuf, 500);
mFile.Close();
memcpy(lpszPath, pbuf, 500);
}
int _tmain(int argc, _TCHAR* argv[])
{
LPSTR lpstr = new char[2000];
memset(lpstr, 0, 2000);
getPath(lpstr, 2000);
return 0;
}
我爸是李刚
|
|
|
|
|
thx for your detailed example
|
|
|
|
|
|
Hi all,
i dont know can can this happen,after running some time my application is fully black,no control or gui display here.
please tell me what can i do for this.
thanks in advance.
|
|
|
|
|
Please switch ON the monitor again.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
monitor is on and other application are fine visible.
|
|
|
|
|
You maight read my answer this way:
You should elaborate: with the provided info we couldn't even guess what is happening with your application.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
With his monitor off, he can't read your advice anyway.
|
|
|
|
|
Luc Pattyn wrote: With his monitor off, he can't read your advice anyway.
The joke was on the line of: "dumb question -> dumb answer".
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you wouldn't say.
|
|
|
|
|
Why not?
THIS IS AN INTERNATIONAL FORUM: PLEASE USE THE ENGLISH LANGUAGE HERE
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
if you intend to come up with a dumb answer for every dumb question, you will end up exhausting yourself.
|
|
|
|
|
So please stop posting dumb questions...
BTW: Sir, we're waiting for the bridge linking CP Vanity Lite with the real thing.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|