|
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
|
|
|
|
|
Can anyone please tell me how i can use two buttons to input a pulse on pins 12 and 13 on the parallel port? I have connected an LCD screen to the parallel port and got it to display, but i need it to display a set sentence when I press a button.
|
|
|
|
|
|
To Hello,
I created another view derived from CView using claswizard.
Somehow the other view cannot recognise the data in the CDocument file.The command "pDoc->m_data" where m_data is declared as a public menber in the doc file failed to compile.
Please advise.
Thanks
S1189216G
|
|
|
|
|
Hi,
Firstly see if have have casted the Document object with your document class.
And if you are trying to create multiple views then better practice is store the address of CYourDocument class into your view class.
Cheers
Mitesh
|
|
|
|
|
To Mitesh,
In my project using VC 6.0, I created another class using classwizard with CView as the base class.
In the created class OnDraw function, the function failed to recognise CDocument data members. Any examples?
Another question.
Why cannot declared the View class(XView, with the X being the project name) in the frame file, but it is possible with CView.
S1189216G
|
|
|
|
|
Hi,
If you are replacing your original view class then its fine. But only precaution you should take is, in CXApp class properly map your view class while instanciating your CSingleDocTemplate class in InitInstance method.
If this is done properly then in OnDraw of CXView you should be able to get your document class.
CXDoc* pDoc = GetDocument();
Also, I hope while retriving document pointer you are creating the pointer to your document class and not CDocument class.
HTH
Cheers
Mitesh
|
|
|
|