|
jalsa G wrote: can any one help me for timer using in c++ consloe application
you need a message loop to dispatch the messages, as WM_TIMER message is anyway queued in the message loop and your console application doesnot have the message loop to extract the message. TimerProc is called back by the default window procedure if you are not handling the WM_TIMER message.
you can add a message loop even in console application to get your TimerProc to be called back.
Creating a Message Loop[^]
|
|
|
|
|
Why would you want to do such a thing ? Another option is inside your callback function, call another function that doesn't take any parameter. Then you can simply call this third function whenever you want.
|
|
|
|
|
Do you really need it? Why?
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
|
|
|
|
|
CPallini wrote: Do you really need it? Why?
to check whether printf uses memory due to bufferring, when it is called within a callback every second. since in his application, memory usage increases, he want to proove his boss this is only because of console IO buffering not because of his programming fault with a console application dedicated with the keyword (callback, one second, printf). see this [^]
|
|
|
|
|
Wow, wasting my time...
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
|
|
|
|
|
CPallini wrote: wasting my time...
|
|
|
|
|
Hey guys,
thanx for your reply. i was not here for some time.
using another function with timer i am able to handle the data. its not because of using printf,cstring or any other resources.
its because of speed of the data which i need to handle in another function. due to that i am using timer.
but it is completed anyway thanx
Jalsa
|
|
|
|
|
Hi all, a simple question but a niggling one nonetheless.
I've written a console application which does what it should, the only issue I have is that it exits after completing processing rather than staying visible to the user to see the processing results.
I'm looking to do a "Press any key to exit" kind of thing. I'm trying to keep it as simple as possible, without putting the whole application into a never ending loop or having to use cin >> to read some key press into any sort of dummy variable before exiting. Is there any clear and simple way to go about this? Thanks, Bryce.
|
|
|
|
|
put a getch() in the end?
|
|
|
|
|
End your console-program with System("pause");
This calls the command interpreter to execute the "pause"-command, which does nothing but wait for a key to be pressed.
Savage, but working.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
thanks for the ideas guys. I looked up getch() and it looks like it might be a compiler extension and not native to C++. The system pause idea sounded reasonable, but when looking up the getch() function i found an alternative to just use cin.get() and ask the user to press ENTER to exit. Thanks for the help!
|
|
|
|
|
Dear All,
Can u help me for getting the BIOS information of System.
Thanks
Anubhava Dimri
|
|
|
|
|
|
I m saying about boot Sector Information.
|
|
|
|
|
Such as?
Have you looked at the Win32_LogicalDisk , Win32_DiskDrive , and Win32_BIOS classes?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How to create a virtual lan using sockets?
|
|
|
|
|
What are your requirements? Aren't VLANs IP based (one OSI level under TCP/UDP sockets)... maybe you want to hook in at a lower level than sockets?
|
|
|
|
|
This is out of shear curiosity. There are large number of gamers who
play lan based games using GG-framework. Even I play Warcraft with
other guys on internet.
But GG (Now Garena) client software does not seem to add any adapter or
driver for creating the virtual lan. I used netstat to find out, there
are two 'ESTABLISHED' TCP connections when I log in to GG.
When one logs in to GG, one has to start the game through this client and viola! one can see all the game servers and one can play as if the other guys are on lan with him.
How this is possible? Anyone got ideas?
And whats port forwarding?
|
|
|
|
|
Hi, i'm searching for a way to transfer data with sockets via the internet. At the moment my applic can only communicate with sockets via the Lan (Peer2Peer). Which is the way to connect two PCs themselves via the internet?
Sorry for my bad english...
|
|
|
|
|
FabS7 wrote: Hi, i'm searching for a way to transfer data with sockets via the internet. At the moment my applic can only communicate with sockets via the Lan (Peer2Peer).
Sounds you are on the right way. I suggest to start a new message in this forum.
|
|
|
|
|
very interesting
|
|
|
|
|
Hi,
We are in a need to develop a text file (VCD - Value Change Dump File) parser. Can anyone suggest which parser generator tool we can use for writing the parser?
Thank you in advance,
With Regards,
Sangeetha.
|
|
|
|
|
|
If Spirit is bit rich for you, you might Google for Bison and Flex the Win32 ports of the classic Yacc and Lex tools from GNU. I used them a few years ago to write a SQL parser so they're plenty capable. You'll need to understand EBNF but that's not going to be stretch.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Traditionally Linux have good tools for text file parsing (for instance awk ) On the other hand, if you were confident with Linux probably you did not post that question.
Another option maybe using one of the .NET languages since the framework features a powerful Regex class.
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
|
|
|
|