|
LitteWindow wrote: Apache is closing the connection when it send it's response
Interesting. The response you showed earlier seemed to me
to indicate a keep-alive connection.
I thought
Connection: close
would be a more correct response in HTTP/1.1
Is it an old Apache server? Or maybe persistent connections
is turned off?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You are correct. I have tried to set this up as a persistent connection but it seams that the web server or app server (Gallery2) is not cooperating. Mix in Winsock's error reporting - Why my second send returns the bytes sent and afterward the recv returns SOCKERROR with WSAGetLastError giving me the 10053, I have no idea why it can't tell me that the server closed the connection instead.
I'm using HTTP/1.1 Apache/2.2.9 on Fedora 9.
I got it (my app) to work by closing the connection and then reconnecting after each message (do a send and recv and then reset the connection). I really don't like doing it as a solution but it works and the reconnect happens fast.
I get 200s back from Apache when doing basic web page requests and when I call the main.php in gallery2, I'm getting valid responses when I format their requests properly. I'm still working on that.
|
|
|
|
|
LitteWindow wrote: I got it (my app) to work by closing the connection and then reconnecting after each message
That's standard HTTP/1.0 behavior - one request/response per connection.
It's pretty inefficient, but it works.
Assuming there's not a proxy between your client and the server
that's giving you HTTP/1.0 behavior, you may be able to configure
Apache with better keep-alive settings.
For example:
Apache: KeepAliveTimeout Directive[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I vaguely remember that about HTTP. I was shown the telnet server port 80 thing back in 1997. And as far as reading the document, hundreds of pages of specs...mmmmmmmm...I resorted to Wireshark and just duped the calls.
No proxy between the client and server - although, that's something I need to consider and the fact that the user will not have any control over the server.
Cheers!
|
|
|
|
|
LitteWindow wrote: The send: It's just a string of not more than a 200 bytes -
Forgot this one...
How does the receiving end know how many bytes were sent?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The interface function need return a bool value,
I'm not sure if true /false is compatible for another app (any kind).
system
modified on Thursday, September 11, 2008 9:19 PM
|
|
|
|
|
followait wrote: I'm not sure if true/false is compatible for another app (any kind).
Zero and non-zero surely are, though.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
When dealing with COM, it is always safe bet to stick with the automation-capable (or dispatch-capable) types. There is a VARIANT_BOOL (VB-bool) type that is just waiting to solve your problem.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi
"Then the loader maps the executable module at memory address 0x00400000 and the DLL module at 0x10000000."
http://www.codeproject.com/KB/DLL/RebaseDll.aspx[^]
I built a dll and export a function which is called GetModuleHandle(NULL);
Then an MFC application which is included this dll.
In Mfc app calling GetModuleHandle(NULL); returns 0x00400000. OK.
But when i called an exported function in the dll, it returned 0x00400000 too.
But I expected to see 0x10000000.
So can we say GetModuleHandle(NULL) always returns EXE's load address even it is in a DLL?
|
|
|
|
|
sawerr wrote: I built a dll and export a function which is called GetModuleHandle(NULL);
GetModuleHandle is a Win32 API function. Did you export the same
named function in a different namespace?
From the GetModuleHandle() docs, lpModuleName parameter:
"If this parameter is NULL, GetModuleHandle returns a
handle to the file used to create the calling process
(.exe file)."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
No, I exported a function which is called GetModuleHandle(NULL);
OK. I got answer.
Thank you very much...
|
|
|
|
|
hello everyone.
I am currently doing my B.tech in CSE ,4th yr.
I have a question in MFC,hope anyone can solve it as soon as possible.
my Question is :
I am loading a bitmap image of different color and i want to know how to get the pixels coordinates of that image.
I have try getpixel and setpixel but i am not able to use it properly, so someone can help where to use this and how to create my work.
I will be very thankful to you.
please either mail me or post it here.
my email id -- kaushal.vickyin@gmail.com
Your Sincerely
kaushal kishore sharma
|
|
|
|
|
kaushal kishore sharma wrote: i want to know how to get the pixels coordinates of that image
Valid coordinates are 0 to width/height - 1
What are you trying to get from the bitmap?
What have you tried that didn't work?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thank you sir for the reply.
Sir i am trying to take a bitmap image suppose A,B,C,D these are 4 alpha. used in image with different colors.
Now my task is to whenever we put the mouse on the alpha. i would like to get the pixels coordinates.
So can you help how should or what should be done in my project part.
i can send you the detail if you want of the program.
Your Sincerely
Kaushal kishore Sharma
|
|
|
|
|
Which part(s) of the task are giving you trouble?
Can you post an example of code that's not working?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thank you sir.
I am searching for net for few days about this part when i create a CColorDlg class the VC++ gets hangs.
Firstly sir i want to know that am i going in right direction for finding pixel coordinates aur not?
then sir i tried out CColordlg for it it gets hangs.
So sir i you have any code where i can include it in my project part i will be very thankful to you.
Your Sincerely
Kaushal Kishore Sharma
|
|
|
|
|
kaushal kishore sharma wrote: i want to know that am i going in right direction for finding pixel coordinates aur not?
I have no idea what you've done.
No need to call me sir
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thank you mark.
can you send me your email id iacan send my code and then you might be able to understood my problem
your sincerely
kaushal kishore sharma
|
|
|
|
|
kaushal kishore sharma wrote: can you send me your email id iacan send my code...
Narrow your code down to a handful of relevant statements. E-mailing someone in bulk is just asking to be ignored.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Take care of the stride?
For example,
the bimap is 8 bit per pixel, and 10*10 in size.
It is not neccesarry that every line contains 8*10 bits.
You might use stride to locate the pixel in the bitmap data.
MSDN:
GDI+ BitmapData
Stride INT Offset, in bytes, between consecutive scan lines of the bitmap. If the stride is positive, the bitmap is top-down. If the stride is negative, the bitmap is bottom-up.
system
|
|
|
|
|
Hi There.
I need some technical help regarding one of the article i.e., "SendKeys in C++".
http://www.codeproject.com/KB/cpp/sendkeys_cpp_Article.aspx
This article is one of the best articles I have ever came across. At this point of moment, Can anyone please tell me how can I read the text written on the active window?
I mean this application can write text on active window, Can you please help me out in reading the same text?
In case you need any further info, then please let me know.
Thanks and Regards.
Pankaj
|
|
|
|
|
char *strBuffer;
int numCharsToRead;
HWND activeWnd;
activeWnd = GetActiveWindow();
numCharsToRead = GetWindowTextLength(activeWnd);
strBuffer = (char) malloc(numCharsToRead+1);
memset(strBuffer, 0, numCharsToRead+1);
GetWindowText(activeWnd, strBuffer, numCharsToRead);
|
|
|
|
|
Yikes...
OK - generally, that will only take the caption if the target window is not an edit control. For a complex view (e.g. CFormView-based views), you will have to descend into the child controls to get at the text-based ones. Using Notepad as an example, you will likely only get Notepad's caption.
You should mention that the above code will not work correctly in a Unicode build and is not TCHAR safe. Also, you do not handle deallocation of the buffer. You can skip the memset(...) by using calloc(...) , but this is not necessary because you allocate enough space for the terminating NUL to be put in.
Might want to use new instead because this is likely a C++ target. (When you get older, you appreciate consistency more and more...)
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Guilty as charged.
Don't know what on earth I was thinking.
Also, strBuffer = (char) malloc(numCharsToRead+1); isn't going to compile anywhere. strBuffer = (char*) malloc(numCharsToRead+1) would be more appropriate, though for reasons mentioned by James, this entire method is still really poor.
|
|
|
|
|
You are right buddy.
I only get the Caption but not the actual text.
Just FYI, my view is a complex (e.g. CFormView-based views). Any pointers, I mean, How can I read data that is being displayed in the same?
A code snippet will be helpful.
Thanks.PanB
|
|
|
|