Re: XtRemoveTimeOut() with value of 0 accvios under 7.3-2, but not



Z wrote:
Hoff Hoffman wrote:

Hoff, checking for a non-zero value will not guarantee that the timer is valid; it might be uninitialized data or the code might not have set it back to 0 after calling XtRemoveTimeOut().

Yes. (Without intending any offense, that much is obvious; that there
are (probably) 2^32-1 wrong answers (or however big XtIntervalId is declared), and one answer that's almost certainly always wrong (0), if there's just one timer outstanding? :-) Pointers and context blocks are like that -- bad I/O channel numbers are an equivalent construct on OpenVMS. Short of carnal knowledge of what's in the target structure or the particular meaning of the context value -- something that's certainly an inviting approach, but generally also not a good idea to know about for reasons of upward-compatibility -- there's often no way to verify these sorts of structures.

Is there a function I can call to validate the timer?

If I knew of one, I'd tell you.

If I'm going to change this code, I want to change it *once* and do it *correctly*. If there's a function available to validate, then I should be calling *that*.

When I can establish the correctness of all possible inputs, then I will have reached spiritual perfection. (Sorry, having a bit of a Zen moment there. :-) Perfection and correctness are not something that can be easily reached in a non-trivial environment -- if at all. Much like any good calculus function, you have to decide how much you are willing to pay for how close you get to perfection, and the closer you get, the more it all costs. X Windows has generally chose to be rather more cavalier about this sort of thing. In this case, I'd certainly look for the zero value (and punt that), and I'd look at how I stored and managed the context values within the application.

Jeez.

I'm not trying to make this difficult.

I know of no way to provide what you want within the context of X Windows, short of rebuilding the whole X Windows platform. If Fred or I knew of a call that immediately solved this, we'd have certainly told you about it.

.



Relevant Pages

  • Re: Odd call stack
    ... This is a unique design in Windows CE. ... The Windows CE Kernel already addressed all of these. ... > cross-process calling. ... >> will save and restore the context of 'callee process', ...
    (microsoft.public.windowsce.platbuilder)
  • Re: listing to a file
    ... batch file but I cannot remember where I found it. ... To create the entry in the context menu it's necessary to first create a ... Save the file in your WINDOWS folder as shown in, ... File Listing will probably be most useful, but you can name yours something ...
    (microsoft.public.windowsxp.general)
  • Win Explorer Context Menu Queue it up, Add to Playlist NOT WORK
    ... During all this year by now I noticed one big problem with Windows ... Windows Explorer Right click Context menu on multimedia files (e.g. .mp3, ... In the first, I was thinking that maybe some WMP Plug-in, or Visualizations ... start to install more Software on it. ...
    (microsoft.public.windowsmedia.player)
  • Re: Right Click Crashes Windows Explorer
    ... Wondering why troubleshooting using ShellExView did not isolate the ... Apparently by doing this I insured that PowerDesk's Context Menus load ... What about other shell extensions (not only Context Menu handlers). ... see if the Event Viewer provides any clue on the Windows ...
    (microsoft.public.windows.vista.installation_setup)
  • Re: The basics of Windows messages
    ... When the receiver next calls GetMessageor PeekMessage, Windows will note that there is a sent message pending, and it will route it to the traget window before fetching the next message from the queue. ... My confusion comes mainly from the fact that the documentation for those facilities usually state that they make the calling thread yield "execution so the operating system can process other events." ... does the code in /ProcessMessages/ actually cause a switching of the execution context? ...
    (microsoft.public.win32.programmer.kernel)