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. process

process

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 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.
  • M Offline
    M Offline
    messages
    wrote on last edited by
    #1

    Hi everyone I have three questions 1.why do I need to use of TEXT macro in my codes and if I remove it compiler shows error 2.why CreateProcess cant open test.txt while second parameter is command line and I have to write full path ("c:\\notepad.exe c:\\1.txt") 3.Do I need to use of WaitForSingleObject STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof (STARTUPINFO); GetStartupInfo (&si); si.dwFlags = STARTF_USESHOWWINDOW |STARTF_TITLEISAPPID ; si.wShowWindow = SW_SHOWMAXIMIZED; si.lpTitle=TEXT("Test"); if(CreateProcess(TEXT("c:\\notepad.exe"),TEXT("c:\\test.txt"),NULL, NULL,FALSE,NULL,NULL,NULL,&si,&pi)) { //WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } Thanks

    D 1 Reply Last reply
    0
    • M messages

      Hi everyone I have three questions 1.why do I need to use of TEXT macro in my codes and if I remove it compiler shows error 2.why CreateProcess cant open test.txt while second parameter is command line and I have to write full path ("c:\\notepad.exe c:\\1.txt") 3.Do I need to use of WaitForSingleObject STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof (STARTUPINFO); GetStartupInfo (&si); si.dwFlags = STARTF_USESHOWWINDOW |STARTF_TITLEISAPPID ; si.wShowWindow = SW_SHOWMAXIMIZED; si.lpTitle=TEXT("Test"); if(CreateProcess(TEXT("c:\\notepad.exe"),TEXT("c:\\test.txt"),NULL, NULL,FALSE,NULL,NULL,NULL,&si,&pi)) { //WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } Thanks

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

      messages wrote:

      1.why do I need to use of TEXT macro in my codes and if I remove it compiler shows error

      See here.

      messages wrote:

      2.why CreateProcess cant open test.txt while second parameter is command line and I have to write full path ("c:\\notepad.exe c:\\1.txt")

      Do you understand the difference between absolute vs. relative paths?

      messages wrote:

      3.Do I need to use of WaitForSingleObject

      Only if you need to wait.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

      M 1 Reply Last reply
      0
      • D David Crow

        messages wrote:

        1.why do I need to use of TEXT macro in my codes and if I remove it compiler shows error

        See here.

        messages wrote:

        2.why CreateProcess cant open test.txt while second parameter is command line and I have to write full path ("c:\\notepad.exe c:\\1.txt")

        Do you understand the difference between absolute vs. relative paths?

        messages wrote:

        3.Do I need to use of WaitForSingleObject

        Only if you need to wait.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

        M Offline
        M Offline
        messages
        wrote on last edited by
        #3

        Do you know your answers are great? Thanks

        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