Execute external file with argument



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/03/2011 at 15:07, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   11.5  
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    **Hi all !

    I'm trying to run a program with

    **

    **Bool GeExecuteProgram(constFilename& program, const Filename& file)

    It works perfectly, but I'd like to add an argument for example "program.exe /argument" and when I add it directly in the filename it doesn't run anymore ... Is it possible or not ?

    Thanks !

    Mike
    **_<_h4_>_



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/03/2011 at 05:15, xxxxxxxx wrote:

    Nope.  The Filename class only sees itself as a path+file structure not a string.  Maybe try the private "GeExecuteProgramEx()" method instead.  You'll have to play with it since the arguments are not explained.

    One option besides is to execute a batch file (but then you lose control of the file since you will be calling GeExecuteProgram("run.exe", "my.bat") basically).  And, of course, this doesn't work the same on MacOS.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/03/2011 at 06:50, xxxxxxxx wrote:

    Yep I already thaught about bypassing it using a batch file, but as you said it is unusable for Macs ... :s

    I'll try GeExecuteProgramEx()

    Thanks again Robert...



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/03/2011 at 01:11, xxxxxxxx wrote:

    Although GeExecuteProgramEx is marked as private it should be safe to use. Pass the pointer to your argument strings to args and the number of arguments to argcnt. You can also pass a function pointer to callback and custom user data to userdata , but this is optionally.

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/03/2011 at 05:57, xxxxxxxx wrote:

    Thanks !

    I suppose GeExecuteProgramEx() will only work in R12 ?

    Mike



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/03/2011 at 07:49, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    I suppose GeExecuteProgramEx() will only work in R12 ?

    It's avaible since R11.5.

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/03/2011 at 07:55, xxxxxxxx wrote:

    Great !

    Thank you.


Log in to reply