Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Header File

Header File

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sweet Flame
    wrote on last edited by
    #1

    I am attempting to get my program to run another program. I looked on the FAQ and it said that one of the best ways to do this was using the WinExec command. I am trying to use this like so: WinExec ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", SW_SHOWNORMAL); I believe this is the correct format, but my compiler says that WinExec is an undeclared indentifier. I'm assuming this means that I need the correct header file. If this is the case, where can I get this header file from?

    B F 2 Replies Last reply
    0
    • S Sweet Flame

      I am attempting to get my program to run another program. I looked on the FAQ and it said that one of the best ways to do this was using the WinExec command. I am trying to use this like so: WinExec ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", SW_SHOWNORMAL); I believe this is the correct format, but my compiler says that WinExec is an undeclared indentifier. I'm assuming this means that I need the correct header file. If this is the case, where can I get this header file from?

      B Offline
      B Offline
      Bartosz Bien
      wrote on last edited by
      #2

      Windows.h. Also, consider using ShellExecute as an alternative. :) Regards, BB http://spin.bartoszbien.com

      1 Reply Last reply
      0
      • S Sweet Flame

        I am attempting to get my program to run another program. I looked on the FAQ and it said that one of the best ways to do this was using the WinExec command. I am trying to use this like so: WinExec ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", SW_SHOWNORMAL); I believe this is the correct format, but my compiler says that WinExec is an undeclared indentifier. I'm assuming this means that I need the correct header file. If this is the case, where can I get this header file from?

        F Offline
        F Offline
        FlamTaps
        wrote on last edited by
        #3

        Sweet Flame wrote: WinExec ("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", SW_SHOWNORMAL); Just a note: You'll need to escape the backslash. The '\' character in a string signifies a special character. You need to use: WinExec("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE", SW_SHOWNORMAL);

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups