|
Thank You.
I don't need any accuracy in the time delay.
My typical usage is to set the timer with several seconds delay.
My problem is that it never arrives, breakpoint in case WM_TIMER: never gets hit.
|
|
|
|
|
Are you sure that the timer is getting created? Check the return value of ::SetTimer.
|
|
|
|
|
Thank You, really I didn't think of checking the return value.
but now I checked and it seems alright
result = SetTimer(m_hWnd, SPECIFIC_CONSTANT ,10000, NULL);
after this,
result = SPECIFIC_CONSTANT .
|
|
|
|
|
result = SetTimer(m_hWnd, SPECIFIC_CONSTANT ,10000, NULL);
You get WM_TIMER after 10 sec. 10000 ms. == 10 sec.
|
|
|
|
|
Thank you and sorry if I'm mistakenly emphasized any need for no-delay.
It just that the messages never gets to the right place, whatever the delay is.
|
|
|
|
|
Hm, you're using PM_REMOVE in PeekMessage, maybe it gets removed from the queue before it hits your message loop?
|
|
|
|
|
Thanks.
As far as I know, it is removed from queue. But it gets in the msg variable, then processed.
|
|
|
|
|
MSDN says "PeekMessage does not retrieve messages for windows that belong to other threads.". So, the messages from your queue will not be removed by others. They will be in queue till you Peek or Get messages. And you can not PeekMessage from a window queue, where the window is not created by your thread
|
|
|
|
|
thanks.
ramana.g wrote: MSDN says "PeekMessage does not retrieve messages for windows that belong to other threads.". So, the messages from your queue will not be removed by others. They will be in queue till you Peek or Get messages. And you can not PeekMessage from a window queue, where the window is not created by your thread
AS far as I know, all my windows and all my application is one thread.
|
|
|
|
|
Thank you all for help and invaluable knowledge !!!
I sure learned a lot.
It turns out, I stuck too much in the case WM_PAINT: ,
and that clogged the WM_TIMER messages.
I rendered all my windows on WM_PAINT (DirectX stuff).
Now, When I drag my windows some ungraceful visual effects happen, but I guess
I'll manage.
|
|
|
|
|
I want to draw a 3D cube without using graphics libraries such as OpenGL. I`m not sure how I can draw the cube. I don`t know what I need to do to draw something 3D.
|
|
|
|
|
See if you can pick yourself up a copy of the book 'Teach Yourself Computer Graphics' or something similar. This will show you how transform a 3D point x,y,z into a 2D point X,Y using a projection. The process uses matrices so you might want to be familiar with simple matrix transformations. Many texts on DirectX also explain this sort of thing but you don't have to use DirectX to take advantage of them if you're prepared to hand code the data structures yourself. Otherwise you might want to try old school drawing in VB6, you can draw directly onto a form pretty easily. I used this to port a simple 3D scene generator from QuickBasic to Windows quite a few years ago. Provided you can handle the mathematics 3D vector drawing is not really so difficult. When it comes to more complex stuff like lighting and shading you're going to need a good book you can follow as the algorithms can be tricky.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
You have to map cube 3D coords into screen 2D ones, you may choose, for instance, perspective transformation or (the simpler) isometric one.
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
|
|
|
|
|
Hi Experts,
How can I Restart my system programtically?
|
|
|
|
|
ExitWindowsEx()[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
see [^].
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
|
|
|
|
|
see this [^]
|
|
|
|
|
how can i create a new process in c
|
|
|
|
|
Use the Windows API CreateProcess .
Maxwell Chen
|
|
|
|
|
|
use:
<br />
int system(<br />
const char *command <br />
);<br />
head file: <process.h> or <stdlib.h>
|
|
|
|
|
I'm very rusty - haven't coded C/C++ since 1994 - and I'm sure there's a simple answer, but I can't find it.
I'm not using 'string' support. Just the old char* methods, and the code is behaving well except when I tried to convert a keyboard virtual key code to a it's ascii character I got a runtime access violation.
The 'break' option showed me the site of the infraction - inside some MS code located in the midst of some UNICODE related logic, judging by the Defines.
I included <ctype.h>, but it didn't help.
The related trimmed code follows:
char c;
c = (char)__toascii(keyCode);
keyCode = p->vkCode;
The offending later statement is:
nLen = fprintf(fOut,"kcK=%d ud=%s kc=%d sh=%d ti=%d %s\n",cb.kcK,updn,keyCode,Shift,tick, c);
The following statement works perfectly (as above, but no c at the end)
nLen = fprintf(fOut,"kcK=%d ud=%s kc=%d sh=%d ti=%d %s\n",cb.kcK,updn,keyCode,Shift,tick);
Searched the articles and FAQ but didn't find anything.
Hope you can give me a hand here.
BTW, I want to stay in the char* arena rather than strings, for now.
I'm using Visual C++ 2003 and running Win2K SP4
One more thing - I'm logged in under my old email glyfyx@storm.ca but I have a new address, glyfix@storm.ca. I guess I should change it at Code Project?
Thanks
glyfyx
|
|
|
|
|
If c is a char , you should use %c . That's all.
Maxwell Chen
|
|
|
|
|
|
Mark Salsbery wrote: I forgot about %c....do you need to cast the c argument to an int when it's passed as
an argument for %c?
No, not needed. Simply this way is fine.
char a = 65;
printf("%c \n", a);
Maxwell Chen
|
|
|
|