Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: New Startprog.pkg

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default New Startprog.pkg

    Hi

    For everyone that is using startprog.pkg (a Replacement/Enhancement of the VDF Runprogram Command): Nils pointed me to a (rare) Issue when long Pathnames and special Characters are used. The corrected Package is attached in the next Post.

    Regards
    Bernhard
    Last edited by Bernhard Ponemayr; 21-Mar-2013 at 05:05 AM. Reason: Attached PKG had a Bug!

  2. #2

    Default Re: New Startprog.pkg

    Hi Everyone

    The original posted Version has a Problem with the Exitcode. I have corrected this. Use the attached PKG.

    Regards
    Bernhard
    Attached Files Attached Files
    Last edited by Bernhard Ponemayr; 21-Mar-2013 at 05:05 AM.

  3. #3
    Join Date
    Mar 2009
    Location
    USA or Sweden
    Posts
    1,424

    Default Re: New Startprog.pkg

    Hello Bernhard,
    Looks at something I'm gonna try out. I have a SQL migration product that uses menus to launch applications for Developers and Clients. BTW you may want to update the code a little NBD, to use Structs and replace the obsolete commands. I'm surprized I have never seen this package before.
    Gregg Finney



  4. #4

    Default Re: New Startprog.pkg

    Hi Greg

    I have written this PKG initially for VDF6 and .........

    i never touch a running System

    I know, that it would be nice to "modernize" the whole Thing, but on the other side such changes could break existing and running Code and that's something i really try to avoid

    Regards
    Bernhard

  5. #5
    Join Date
    Jan 2009
    Location
    Richmond, VA
    Posts
    5,435

    Default Re: New Startprog.pkg

    Bernhard,

    We hear ya
    Best regards,

    -SWM-

  6. #6
    Join Date
    Mar 2009
    Location
    USA or Sweden
    Posts
    1,424

    Default Re: New Startprog.pkg

    I think it would be hard to break just making these few changes, but you would break it in 6.
    Gregg Finney



  7. #7

    Default Re: New Startprog.pkg

    Hi,

    Attached is an updated version that uses more modern code (structs etc..)
    None of the functionality has been changed, just the code and in regards to not breaking anything, the changes have been kept to a minimum.

    StartProg-20170925.zip

    cheers!
    --
    Wil

  8. #8
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    8,375

    Default Re: New Startprog.pkg

    Hi Wil,
    I think you missed two zerostring commands, at least in your attached version.

    Does anyone know how to return a specific exit code from DF so that StartProg returns that value? I need to have an indicator of what happened and the comments seem to indicate that it's possible.
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

  9. #9

    Default Re: New Startprog.pkg

    Hi Bob,
    Quote Originally Posted by Bob Worsley View Post
    Hi Wil,
    I think you missed two zerostring commands, at least in your attached version.

    Does anyone know how to return a specific exit code from DF so that StartProg returns that value? I need to have an indicator of what happened and the comments seem to indicate that it's possible.
    You mean as a replacement for these lines?
    Code:
        zerotype STARTUPINFO to sStartup
        zerotype PROCESSINFO to sProcessInfo
    No need to zerostring those structs.
    I initialized an element on each of those structs and as such they a) exist and b) are empty.
    Unless you mean something else, I don't see an issue with it right now. (Haven't checked MSDN against the code now, so I might be missing something obvious)

    As for your question, I think you might have missed the doc, it is functionality offered already.

    // returns:
    // -1 If the programm could Not be started
    // ProcessID if the programm was started and the WaitUntilFinished Parameter was FALSE
    // ExitCode of the started program if the programm was started and the WaitUntilFinished Parameter was TRUE
    Obviously you can only get an exitcode when you wait until the program you are running is finished.

    Attached is my latest update (max version DF 19.1, basically just a merge with Sture's changes, use his version for DF20)

    edit: Oh.. I should read better.. you didn't miss it.. try my latest version, it has changes for this part.
    --
    Wil
    Attached Files Attached Files
    Last edited by wila; 7-Sep-2020 at 06:13 PM.

  10. #10
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    8,375

    Default Re: New Startprog.pkg

    Hi Wil,
    What I meant about the Zerostring command is that it's throwing warnings in 19.1, I should have said that. I changed them to Move (Zerostring(32)) to sExitCode and the warnings went away. Maybe they aren't necessary as you said?

    Regarding the exit code, the exit code is always 0 from StartProg and I do have the WaitUntilFinished parameter = True. is there something in the program I'm calling with StartProg that I need to set? I'm calling a function in a small program and that function returns a value but that isn't being returned to StartProg but maybe I just don't understand how it's supposed to work.
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

Posting Permissions

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