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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. WinExec

WinExec

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
4 Posts 4 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.
  • O Offline
    O Offline
    OTVAC305
    wrote on last edited by
    #1

    Help! I am using Winexec to call another C++ compiled program. All at once the button won't execute the program, but I CAN start the program by double clicking it's icon. Code I'm using: WinExec("MyProg",SW_SHOW); If I double click the MyProg icon, it runs fine! The button used to work, but just quit. I am flummoxed:confused: Any help greatly appreciated! Richard

    RaviBeeR A M 3 Replies Last reply
    0
    • O OTVAC305

      Help! I am using Winexec to call another C++ compiled program. All at once the button won't execute the program, but I CAN start the program by double clicking it's icon. Code I'm using: WinExec("MyProg",SW_SHOW); If I double click the MyProg icon, it runs fine! The button used to work, but just quit. I am flummoxed:confused: Any help greatly appreciated! Richard

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      Try specifying the full filespec path, eg:

      WinExec (_T("C:\Dir\MyProg.exe"), SW_SHOW);

      /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

      1 Reply Last reply
      0
      • O OTVAC305

        Help! I am using Winexec to call another C++ compiled program. All at once the button won't execute the program, but I CAN start the program by double clicking it's icon. Code I'm using: WinExec("MyProg",SW_SHOW); If I double click the MyProg icon, it runs fine! The button used to work, but just quit. I am flummoxed:confused: Any help greatly appreciated! Richard

        A Offline
        A Offline
        Alexander M
        wrote on last edited by
        #3

        why can't u guys just read the documentation!? Don't try it, just do it! ;-)

        1 Reply Last reply
        0
        • O OTVAC305

          Help! I am using Winexec to call another C++ compiled program. All at once the button won't execute the program, but I CAN start the program by double clicking it's icon. Code I'm using: WinExec("MyProg",SW_SHOW); If I double click the MyProg icon, it runs fine! The button used to work, but just quit. I am flummoxed:confused: Any help greatly appreciated! Richard

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          WinEXec is deprecated - it may be removed from Windows at some point in the future. It's only for backwards compatibility with 16-bit Windows. You should consider using ShellExecute or CreateProcess instead. CreateProcess is normally preferred if you know that the file is an executable. In either case, the executable found (and even if it's found) depends on the executable search path. See CreateProcess in MSDN[^] for more details.

          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