|
Why not actually do a ping (ICMP echo)?
You could then use IcmpSendEcho() which has a timeout in milliseconds that can be set.
See the IP Helper Reference[^] for the other Icmp Echo functions.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Antony M Kancidrowski wrote:
Why not actually do a ping (ICMP echo)?
This might have been a viable solution 3+ years ago, but servers of late have turned off PING replies. So even though you PING a valid, working server, if the server has PING replies turned off, you'll get no reply, making it look like an invalid address.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Quite true.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
i used the that function and it gives me error
the procedure entry poingt createfile could not found in the dynamic link libaray iniphlpapi.dll...
Plzzz suggest some solution soon
|
|
|
|
|
Without seeing your code it is hard to say what the problem is.
Ensure you have included these headers
#include "iphlpapi.h"
#include "winsock2.h"
#include "icmpapi.h"
and you are linking to these libraries
icmp.lib
Ws2_32.lib
NOTE: You need the winsock2 stuff if you use inet_addr() to generate the destination address.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi,
Is there ate any alternate option available instead of STL List. I have created template class, also tried with Linked List. But it's search option is very slow. Let me know good suggestion from you.
Regards
Rajesh
|
|
|
|
|
hi Rajesh..
I am doing a projec based on broadcasting.it means simultaneously passing the message to all the clients in the intranet.ie;server broadcasting the message to all the clients.got to do it in the windows platform ie;vc++.
Kailai
|
|
|
|
|
Have you tried any of the other STL container classes, I think a set should give you faster lookup times.
|
|
|
|
|
No, But i want alternate for STL classes.
Be simple and Be sample.
|
|
|
|
|
std::map - when doing lookups
std::vector - could be used if you are using fixed index
|
|
|
|
|
i think you don't even undertand what is STL classes .
std:: is the namespace defined by the C++ for the standard library, and unfortunately (for you), map s and vector s and classes from the Standard Template Library (also said STL )...
so please, read the posts before you answer them
see you
TOXCCT >>> GEII power
|
|
|
|
|
Curiously, Why do you need an alternative to STL? What prevents you from using STL? Why is it a bad thing?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
My friends are saying the Usage of STL List makes more weitage to your application. Especially on Linux. What about ur suggestion?
Regards
Be simple and Be sample.
|
|
|
|
|
it depends on what you need also...
i can suggest you to write your own containers if you think you're able to, otherwise, i don't know such alternative based on the standard C++.
Off course, there are lists in MFC for example, but not available under Linux (and certainly not even lighting your binary...).
can't help you more, sorry...
TOXCCT >>> GEII power
|
|
|
|
|
Hi
Currently I am building an app that receives frame input from a camera and performs some computations on it. My problem is, my app is currently processing the frames as fast as possible, and that makes the computer's response very slow for other apps, i.e. my application work like this:
while(app not closed)
getinput();
processinput();
displayoutput();
end while
Since this app may be run on a PC for hours and I don't want to disturb other apps' processing, is there a way for my app not to hog the CPU power while it's running, provided I can tolerate some drop in the frame rate?
Thanks!
|
|
|
|
|
Perform the processing in a low priority thread. It will use all the CPU it can, but if a higher priority thread needs the processor it will get it.
Mike
|
|
|
|
|
Indrawati wrote:
while(app not closed)
getinput();
processinput();
displayoutput();
end while
make it (not so good)...
while(app not closed))
{
PollOnSomething(event)
process()
display()
Sleep(0);
}
make it (better)...
while(app not closed))
{
WaitForSingleObject(event)
process()
display()
}
...or better why not using normal windows messaging, post yourself a message e.g. WM_APP when "input" is available and handle it in a messange handler.
|
|
|
|
|
As has been pointed out, running the loop in a separate thread is probably the best solution. If you don't want to use multiple threads, see the section "Responding to user input while performing a long task" in this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hai frens,
Do any body know how to control the enlarge and shrinkage of our application as a result of the change in the resolution of the monitor ?
Plz let me know, some solution to scale our application depending on the resolution of the monitor using MFC. . .
Thanx
|
|
|
|
|
I am not certain but it is best that you figure it out for yourself.
Here's a tip :
Open up the spy and set it to monitor the messages your app's main window gets.
Open up the display properties dialog and change the resolution.
Note the particular message your app gets and handle it appropriately.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
You could try handling the WM_SETTINGCHANGE message. If it's called in response to a change in the screen's resolution, just re-get the res and resize your window accordingly. Otherwise, you could poll the screensize every n units of time (cheesy solution) to check the current screen res.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
Could any one help me to fast my search on Linked list application. Is there any method to search on linked list. Now i am searching by getfirst and getnext function to retrieve the next node datas.
Regards
Rajesh.
|
|
|
|
|
For faster searching use indexes and binary search algorthm
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
If you want to keep a linked list you won't search very fast, unless you add some other data structures with it.
I'd suggest data hashing (order 1 search with a good algorithm) or AVL trees, which are better than binary search trees but require more work.
Andrew
|
|
|
|
|
Hi Andrew,
Could you provide me more information about AVL trees, it will be great if you provide me some samples.
Thanks
Rajesh
|
|
|
|