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. ShellExecute and execl woes

ShellExecute and execl woes

Scheduled Pinned Locked Moved C / C++ / MFC
2 Posts 2 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.
  • K Offline
    K Offline
    KnaveWave
    wrote on last edited by
    #1

    Im writing a front end for a console prog in VCPP and am having a hell of a time trying to pass params. For some reason whenever i use ShellExecute to pass params the programm receiving them interperates all params as a single param and fails (according to its log). If i use _execl it works perfectly only my app terminates for some odd reason. Im a fairly experienced programmer and have just started out w/ windows programming. This is also my first windows app thatll serve a purposed btw :) Heres the ShellExecute code that doesnt not pass the params correctly: ShellExecute(NULL, "Open", "C:\\Program Files\\UT2004\\System\\ucc.exe", "compress AS-Convoy.ut2", NULL, SW_SHOWNORMAL); And heres the _execl that works but kills my app: execl("C:\\Program Files\\UT2004\\System\\ucc.exe", " compress", "AS-Convoy.ut2", NULL); * note the space before " compress" if i leave out this space the called prog fails. ive tried the same thing w/ ShellExecute but it still fails. If anyone has an idea about how i should go about getting ShellExecute to pass the params different or how i can stop _execl from killing my app id be very greatful. Oi! Oi! Oi!

    D 1 Reply Last reply
    0
    • K KnaveWave

      Im writing a front end for a console prog in VCPP and am having a hell of a time trying to pass params. For some reason whenever i use ShellExecute to pass params the programm receiving them interperates all params as a single param and fails (according to its log). If i use _execl it works perfectly only my app terminates for some odd reason. Im a fairly experienced programmer and have just started out w/ windows programming. This is also my first windows app thatll serve a purposed btw :) Heres the ShellExecute code that doesnt not pass the params correctly: ShellExecute(NULL, "Open", "C:\\Program Files\\UT2004\\System\\ucc.exe", "compress AS-Convoy.ut2", NULL, SW_SHOWNORMAL); And heres the _execl that works but kills my app: execl("C:\\Program Files\\UT2004\\System\\ucc.exe", " compress", "AS-Convoy.ut2", NULL); * note the space before " compress" if i leave out this space the called prog fails. ive tried the same thing w/ ShellExecute but it still fails. If anyone has an idea about how i should go about getting ShellExecute to pass the params different or how i can stop _execl from killing my app id be very greatful. Oi! Oi! Oi!

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      What results do you get with CreateProcess()?


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      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