Opening file with other program

This is a discussion on Opening file with other program within the C++ Programming forums, part of the General Programming Boards category; Hi everyone, Is there a way to open a file with it's respective program (eg: Word files with Word, images ...

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    128

    Opening file with other program

    Hi everyone,

    Is there a way to open a file with it's respective program (eg: Word files with Word, images with picture and fax viewer, etc...) using C++?
    Thanks.

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    611
    system("C:/this/is/my/file.doc");

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,641
    ShellExecute is probably a better choice here.

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    1,602
    Quote Originally Posted by rags_to_riches View Post
    ShellExecute is probably a better choice here.
    Indeed.
    When i'm using "system" instead of "ShellExecute", the console window pops up even if i have disabled it!
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Free glut, Rastering a .raw file
    By Falconmick in forum C Programming
    Replies: 3
    Last Post: 04-03-2011, 04:41 AM
  2. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 03:49 PM
  3. Last program!!
    By buckwheat88 in forum C++ Programming
    Replies: 12
    Last Post: 01-17-2006, 11:31 AM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 09:46 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21