|
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
|
|
|
|
|
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++.
IF ANYBODY COULD SEND ME THE SAMPLE SOURCE CODE IT WILL BE A GREAT HELP .
|
|
|
|
|
Chaps,
I am using ADO to read and write from a MySQL database. The date in MySQL is stored as YYYY-MM-DD, but when I read the date back using ADO it gives it to me as YYYY/MM/DD. Also, the date in MySQL will always have leading zeros for Month and Day (ie 2004-09-01), whereas ADO gives me 2004/9/1.
My question is, not matter what format the date is in the database I am connecting to, will ADO always give it to me as YYYY/MM/DD without leading zeros? I am not sure if this is a standard feature of ADO. If not, how can I get a standardized way of dealing with date and likewise with times? The program I am writing needs to work on different language operating systems. I ALWAYS want the date in format the database deals with. Is there a simple way of getting round this?
Any help would be much appreciated.
Graham.
|
|
|
|
|
I don't think the RDMS or ADO is the concern. You need the returned date presented to you in a particular format. This you can do depending on the data type that the date is being returned.
If your ADO class is returning a COleDateTime type, then its very easy to format the date to your style, or locale.
For example:
<code>
..
COleDateTime dt;
CADORecordset rs;
..
rs.GetFieldValue(1,dt); <font color=green>
cout << (LPCTSTR)dt.Format(_T("%Y-%m-%d")) << endl; <font color=green>
cout << (LPCTSTR)dt.Format(_T("%d/%m/%Y")) << endl; <font color=green>
</code>
I Dream of Absolute Zero
|
|
|
|
|
Hi,
I am trying to develop a driver installer.
the total softwar has the following :
1. two device driver
2. the main application
The main application requires DirectX 9.0.
I need the installer to automatically install the device driver with or without the device pluged in. It should also
check the DirectX version and install it if the existing version is lower.
Also can u pls tell me wat software can i download that can make the installer?
i heard of visual installer which is free. is there any ohter software that can help me accomplish the above task? and how can i do that(especially the directX checking part)
Thanks a lot..
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|