|
Set the timer once in the dialog's OnInitDialog() method.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thanks, but, it's like in the OnPaint();
|
|
|
|
|
Do you realize how many WM_PAINT messages a window handles? With few exceptions, that's not a good choice for turning a timer on.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I don't understand why you have to set the timer again because it will repeatedly called. If you want to handle multiple timers, you can call SetTimer() with multiple Id, for example
SetTimer(12, 2500, NULL);
SetTimer(1361, 2500, NULL);
Then in the OnTimer(UINT nIDEvent), you can process it as below:
if(nIDEvent == 12){
...
}
if(nIDEvent == 1361){
...
}
|
|
|
|
|
That means the timer will be set every time a WM_PAINT message is received. A very bad idea, since you have no control over it.
Use the best guess
|
|
|
|
|
Tried to put SetTimer() in OnInitDialog(), just trigger OnTimer() once, so weird.
But it is a old project wrote by others, I just tried to add a timer, to do something.
I wonder timer is a resource, like c++ "new" something, right? it will take up memory, if settimer repeatedly, no killertimer, then that means it will use more and more memory, right?
|
|
|
|
|
I have a new question about SetTimer(), if I use a unique ID, say,
SetTimer(2, 1000, NULL), then, I repeat this statement many times,
SetTimer(2, 1000, NULL),....
Then, I set one timer named 2 many times, or I set many timer with same name 2? that is, after 100 SetTimer(2,1000,NULL); there is only one Timer with name 2 in the system. or there are 100 pcs Timer with name 2 in the system?
|
|
|
|
|
In this case you are just resetting Timer2 with every call, but why do that - again it serves no purpose. Maybe it would be better if you actually explained what problem you are trying to solve.
Use the best guess
|
|
|
|
|
Thanks, I just want a module to work, so I can test my new function in that module.
No enough time to find why the timer needs to reset.
Then you think in OnTimer() function, I use SetTimer(2,1000,NULL), it's not create a new Timer, just reset
the ID=2 Timer, right?
|
|
|
|
|
econy wrote: I just want a module to work, so I can test my new function in that module. I'm afraid that does not help us to understand why you need a timer.
econy wrote: SetTimer(2,1000,NULL), it's not create a new Timer, just reset the ID=2 Timer, right? That's correct; see here[^] for further information.
Use the best guess
|
|
|
|
|
Thanks, then setTimer(id2) many times, means reset the id2 timer, right?
The system not create many timers.
|
|
|
|
|
How many more times do you need to ask this? Go and read the documentation if you cannot believe what you have been told.
Use the best guess
|
|
|
|
|
I am building an application that needs to compress data before being sent via socket. Performance is very very critical and I want to make use of native functions i.e. no interop calls into .net libraries. I am building it as a C++ application.
I did find Compression API that will take an input and provide a compressed output. PLEASE BEAR THE FACT THAT I AM NOT USING ANY FILES (DISK FILES). Instead I am just dealing with raw stream.
But this Compression API is available only from Windows 8 onwards and Windows Server 2012. How do I go about finding a solution if I were to do this on Windows 7 and and a server that is say 2008 or 2003
Hickups:
Cabinet API does not help as it always does it thru files?
Explored the option of CMemFile and see if I can break the ice but the m_handle is of no use nor will there be a need to open or close files as I am just dealing with raw bytes.
|
|
|
|
|
|
Hi,
I am trying template for splitter view but getting error in IMPLEMENT_DYNCREATE_T.
I am using VS2008. Plz help
|
|
|
|
|
And the error message is anybodys guess.
|
|
|
|
|
It gives error at :
IMPLEMENT_DYNCREATE_T (TView, U, CView)
Error is
" error C2275: 'TView<U>' : illegal use of this type as an expression"
Please help.
|
|
|
|
|
That does not match with the line of code you have shown. However, assuming that's just a typo, where is TView<U> defined?
Use the best guess
|
|
|
|
|
New motherboards do not have built in printer ports. There are many devices that used these ports. I have several chip programming adapters.
I would like to be able to read and write the LPT ports directly. Not using the Windows print spooler.
Does anyone know where to get the port information for PCI parallel port?
Bob Macklin
Seattle, Wa
|
|
|
|
|
|
The people that sell the PCI parallel cards will not give you the information on how to direct access them.
Bob Macklin
Seattle, Wa
|
|
|
|
|
|
Yes, I read that article. As it says, the PCI parallel card are useless for anything other than connecting a printer. They are not a PCI implementation of the original ISA parallel card.
I have aone computer with a motherboard PP. I have an older Pentium motherboard with both a motherboard PP and ISA slots. So the most rational solution is a special computer for my programmers that use the PP devices.
Thanks for the help.
Bob Macklin
Seattle, Wa
|
|
|
|
|
Have you considered fitting a PCMCIA (Cardbus) slot? there are loads of pcmcia printer port cards.
software-dongle-lpt-pcmcia.html
modified 22-May-13 5:04am.
|
|
|
|
|
That's an interesting solution but I need to do this to a non-laptop computer.
My laptop does have an available motherboard printer port.
A PCMCIA slot is equivalant to an ISA slot.
Bob Macklin
Seattle, Wa
|
|
|
|