|
Hi,
BTW.
That Reg Entry. If you delete that, does that 'Undo' Drive mapping. I know of no way to 'Unmap' a drive in XP. Does not bother me much, I never realy use this 'Drive Mapping Feature' I personally think that it is a leftover from the DOS days, (maybe you don't remember those)
Those where the days that God was with us in Paradise, and all of us had Floppies. Lo and Behold, Someone invented the CD. Everybody took a step back and admired in awe, and all those guru's, came up with further int14's and complicated code, to assign those horrid things a drive letter, using a device called MSCDEX, etc. Afterall, DOS could only deal with Block devices if they had a Drive Letter, so a drive letter it got.
Then some Nasty bugger invented Networking! Not to worry, MS had already a Mechanism to map Drives... Just another Interrupt, And, Presto, we had 'Share', with, guess it... A Drive Letter!
Me thinks, No real need for all that crap. UNC Names are about as good as it gets.
The problem occurs, where XP supports this anachronism. Some of my customers use Network Shares assigned to a Mapped Drive. Over Time, Things break, and I have to unravel the mess in a Fix, but, Idealy trap it during the Setup.
Thanks for your Contribution.
Regards
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: I know of no way to 'Unmap' a drive in XP
chuckle - in the old days it used to be (command line)
net use drive: path to map
net use drive: /delete to unmap/delete
still works on xp last time I looked - I suspect (going back to the 'NetShare API' you can do it programmtically through them as well)
shows ya what an ol' fart I am - but willing to learn new tricks, like as you suggest, deleting that reg entry - didnt know that one
'g'
|
|
|
|
|
In the case we setting WM__TIMER to the small value for example 20 msec that mean the thread will work on OnTimer function every 20 msec.
Assume that, during the thread work on the first period time message in OnTimer function but still not finish, then the second period time message overlap happen so that this message should wait for the first message finish before it continue.
Again assume that, the first message not finish and the second message wait for first message, then the third period time message happen.
How windows manage this situation.
Thanks.
|
|
|
|
|
WM_TIMER is only posted once.
That means that if there is already a WM_TIMER in the message queue it is not posted again.
So at any time there is only one WM_TIMER in the message queue.
|
|
|
|
|
What about another message, for example WM_MOUSTMOVE if we have a lot of code within OnMouseMove function the first message not finish but another one come in.
How windows manage this situation or just ignore it?
|
|
|
|
|
There are certain rules involved:
1. Main window procedure can process only one message at the time.
2. WM_TIMER message is posted to a thread’s queue.
3. Messages posted to the queue are retrieved and removed in a main message loop by GetMessage. There is always one global message loop per process. Local message loops can be created but that is not a case here and it does not change this set of rules.
4. Retrieved messages are delivered to a window procedure by DispatchMessage call.
5. When message is processed, system posted messages are not delivered to a message queue, since the thread is blocked.
Let’s assume you register timer calling SetTimer. After time elapses, system posts the WM_TIMER message to a queue.
Message is then removed and window procedure or callback is called.
If timer message is processed for a time much longer that time interval used to register timer, thread id blocked and no messages are added to a queue.
If processing time is very long, it will render application unresponsive.
After processing is done, queue receives all new messages that are posted by the system.
WM_MOUSEMOVE message as other mouse messages are also posted to the queue, hence if thread is blocked by long processing of any message window will loose WM_MOUSEMOVE, resuming receiving after processing is done.
Timer is not precise. It has low priority and GetMessage can retrieve other messages first before WM_TIMER is retrieved; it is really at the bottom of the food chain.
There is also a set of messages that are delivered by SendMessage directly to a window procedure without being posted.
Considering this and low priority of the WM_TIMER it should not be used when timing is crucial. If that is a case, use another thread to handle such a case.
JohnCz
MS C++ MVP
|
|
|
|
|
|
This is a misuse of WM_TIMER, because it is to often so it will lower performance with its overhead.
If you need such high frequencies of calling write a seperate thread which handles such stuff.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Well, I do not think this is a WM_TIMER misuse issue. Timer is not posted as high priority message and is retrieved as the last after all others and only during a system idle, that is why is not guaranteed that it will be delivered in intervals it was registered with.
The issue here is the fact that timer can be used to handle some long processing and that is what can cause problems.
JohnCz
MS C++ MVP
|
|
|
|
|
Is it posible to change the priority message in the process?
What's function can support this issue ?
|
|
|
|
|
No, it is not possible, that is the way OS works.
Why is it so important to you?
AS I havew already indicated, if you have to do some long processing you would be much better off, moving processing to a dedicated thread, freeing main thread to do GUI updates and process all other messages without freezing.
JohnCz
MS C++ MVP
|
|
|
|
|
So the message queue got filled with unworked WM_TIMER messages. What is that positive? If someone needs to handle some stuff he is waiting and nothing is happening.
That is not a good style to write a program
To be honest I would call it a "mistake by design"
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
any body could help with prolog programming?
|
|
|
|
|
Unfortunately this is a C/C++/MFC forum, however, please, let me google that for you...
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
[My articles]
|
|
|
|
|
What puzzles me most is that people manage to find this site but seem to be unaware of the existence of search engines...
|
|
|
|
|
I was googling something the other day and came across a hit with the exact same question. When I looked closer the first 'answer' was "Try CodeProject and they will give you the answer". If that is always the top hit then little wonder people stop searching at that point.
|
|
|
|
|
Good point but hardly relevant in this case. Still, you are probably right that in many cases, CP showing up on top of many searches might explain this.
|
|
|
|
|
Michael Schubert wrote: Good point but hardly relevant in this case.
Point taken, but if they used the site which had this entry then they would be redirected here and expect an instant solution.
|
|
|
|
|
Right!
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
[My articles]
|
|
|
|
|
Me remember my courses in prolog that one of the most usual answers are
no
or
yes
This signature was proudly tested on animals.
|
|
|
|
|
Ok, I know there is a windows function that allows one to get the Process ID of the app that owns a HWND window handle by passing in the HWND but for the life of me I can not remember what it is. Any ideas?
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
modified on Thursday, November 26, 2009 3:16 PM
|
|
|
|
|
|
That is the one, thanks!
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Is it possible to List Windows registered users? In VC++6 please
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
The Win32_UserAccount Class[^] contains the information you are probably looking for, but I am not sure if VC6 will support it; you may need to upgrade to the latest SDK.
|
|
|
|