Launch Application with CmdLine

Discussion in 'Mac Programming' started by dom3d, Apr 10, 2010.

  1. dom3d macrumors newbie

    Joined:
    Apr 10, 2010
    Location:
    Kiev
    #1
    I want to use LaunchApplication

    Code:
    Bool SYS_LaunchExeFile(const char FileName[], const char CmdLine[], bool bForeground )
    {
    	LaunchParamBlockRec    launchParams;
    ...
    
    	Status = LaunchApplication( &launchParams );
    ...
    }
    And I don't know how define CmdLine to structure LaunchParamBlockRec.
    Help me please.
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    Exactly what are you trying to do?

    Are you trying to launch a command-line tool like 'ls' or 'cat'?

    Or are you trying to launch a graphical application like TextEdit?

    What do you want to happen after the launch?

    If you're following a book or tutorial, identify exactly which one it is: URL, title, author, etc.
     
  3. dom3d thread starter macrumors newbie

    Joined:
    Apr 10, 2010
    Location:
    Kiev
    #3

    I want to launch Application gmsh with command line
    Temp.stp -clmax 2.5 -clmin 0.1 -string "Mesh.SubdivisionAlgorithm = 0;" -3 -format ir3 -o "Mesh1.txt"

    Afte launch gmsh must to read file Temp.stp and save mesh to file Mesh1.txt
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    Do you want gmsh to finish running, or do you want to let gmsh run concurrently?


    Is there some reason you can't use the standard C library function system()?
    http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man3/system.3.html

    Or maybe popen()?
    http://developer.apple.com/mac/libr...man3/popen.3.html#//apple_ref/doc/man/3/popen


    What is your programming experience? Have you written C programs? Have you written Mac OS X programs?

    Are you porting gmsh? Writing a new program to use gmsh?
     
  5. dom3d thread starter macrumors newbie

    Joined:
    Apr 10, 2010
    Location:
    Kiev
    #5
    chown33, thank you for your answer. I try to use your version of code.

    I have programming experience C++ on Windows 10 years.
    But on Mac OS X I working about two month. In old project Cobalt.
    Function LaunchApplication I found in src of program Cobalt.
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    I've never heard of Cobalt. When I google (mac os cobalt), I don't see much other than an expensive 3D program listed on VersionTracker. I don't see any source.

    If you expect someone else to know what you mean by Cobalt, you'll have to be more specific.
     
  7. dom3d thread starter macrumors newbie

    Joined:
    Apr 10, 2010
    Location:
    Kiev
    #7
    Cobalt 3d-CAD for Win and Mac. Written on C++.
    http://ashlar.com/sections/products/cobalt/cobalt.html
     
  8. dom3d thread starter macrumors newbie

    Joined:
    Apr 10, 2010
    Location:
    Kiev
    #8
    Successful complete the task by using
    system();

    chown33, thank you very much!
     

Share This Page