Results 1 to 2 of 2

Thread: So So Close...Run App

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    113
    #include "stdafx.h"
    #include <string>
    #include <windows.h>

    int main()
    {
    char* sStr;
    sStr="notepad.exe";
    WinExec(sStr,SW_SHOW);
    return 0;
    }

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The Windows headers don't use the STL, and as such don't understand the string class. Use this:
    Code:
    WinExec(sStr.c_str(), SW_SHOW);
    PS: WinExec is obsolete and shouldn't be used any more, as it is expected to be deprecated in later versions of Windows.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width