Results 1 to 3 of 3

Thread: DoStartDocument oddity

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Cayman Islands
    Posts
    3,969

    Default DoStartDocument oddity

    Had it reported to me that DoStartDocument wasn't working in either 20.0 or 19.1.

    Hmm it certainly used to, as at least one daily-run-but-not-recently-compiled-program relies on a report displayed by that method.

    So I debug, and I find this... (in every version I can find)

    Code:
    Procedure DoStartDocument GLOBAL String sOperation String sDocument
       Local Integer hWnd
       Local Integer iRetval
    
    
       Get Window_Handle To hWnd
       If (hWnd > 0) Begin
          Move (ShellExecute
    hWnd is ALWAYS zero, so why did it ever work? Subversion says this hasn't changed furrevah!

    Found a MatthewD version which omits the line in red (so why bother having the one in green?) and removing the red line makes it work.

    Confused in Cayman...
    I should be on a beach ...

  2. #2
    Join Date
    Feb 2009
    Location
    Hengelo (NL)
    Posts
    1,891

    Default Re: DoStartDocument oddity

    In a program with a 'window' the window_handle will always have a value, but in a program without a window (like webapp or a background process without UI) the window_handle will be 0. I do not think there is a reason to check if it is > 0. It can be valid as you have found out already.

  3. #3
    Join Date
    Feb 2009
    Location
    Cayman Islands
    Posts
    3,969

    Default Re: DoStartDocument oddity

    Quote Originally Posted by Evertjan Dondergoor View Post
    In a program with a 'window' the window_handle will always have a value, but in a program without a window (like webapp or a background process without UI) the window_handle will be 0. I do not think there is a reason to check if it is > 0. It can be valid as you have found out already.
    I'm mostly puzzled by it ceasing to work across 19.1 and 20.0 simultaneously except in a small number of cases. It has to be the point where it's triggered, I suspect, though I spent an unhappy hour or two trying to work out if there was a stray version somewhere.

    In each case there is a current UI, albeit the program has finished doing actual work, and the thing being dostartdocument-ed is a summary or error report.
    I should be on a beach ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •