Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9075729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:55:47+00:00 2026-06-16T18:55:47+00:00

I get the following error from the program below: CreateProcess failed(3) int __cdecl main(int

  • 0

I get the following error from the program below: CreateProcess failed(3)

int __cdecl main(int argc, char **argv)
{
    USES_CONVERSION;
    string name_of_bitmap;
    cout << "Name of file: ";
    cin >> name_of_bitmap;
    string arguments = "F:\\windowsqnx\\maps\\show_simulation\\Debug\\show_simulation.exe " + name_of_bitmap;
    const char * nob;
    nob = arguments.c_str();
    std::wstring stemp = s2ws("F:\\windowsqnx\\maps\\show_simulation\\Debug\\show_simulation.exe");
    LPCWSTR path = stemp.c_str();
    // runing simulation display process
    STARTUPINFO si;
    PROCESS_INFORMATION pi;

    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );

    // Start the child process. 
    if ( !CreateProcess(path,
        A2W( nob ) ,
        NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        FALSE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory 
        &si,            // Pointer to STARTUPINFO structure
        &pi )           // Pointer to PROCESS_INFORMATION structure
        )
    {
        printf( "CreateProcess failed (%d).\n", GetLastError() );
        Sleep(2000);
        return 1;
    }
}

I’m new to processes and can’t figure out what I do wrong. I read this and did the following string arguments = "\"F:\\windowsqnx\\maps\\show_simulation\\Debug\\show_simulation.exe\" " + name_of_bitmap; and std::wstring stemp = s2ws("\"F:\\windowsqnx\\maps\\show_simulation\\Debug\\show_simulation.exe\" "); then getting the error 123 if I NULL the first parameter CreateProcess(NULL, I get the failure 2. Please help.

EDIT

std::wstring s2ws(const std::string& s)
{
   int len;
   int slength = (int)s.length() + 1;
   len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0); 
   wchar_t* buf = new wchar_t[len];
   MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len);
   std::wstring r(buf);
   delete[] buf;
   return r;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:55:49+00:00Added an answer on June 16, 2026 at 6:55 pm

    Error 2 is

    ERROR_FILE_NOT_FOUND
    2 (0x2)
    The system cannot find the file specified.
    

    Either the path you specified is for a file that doesn’t exist or s2ws is doing something funky to your string. Can we see s2ws?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I compile the pared-down program below, I get the following error from the
When running a Python program that reads from stdin, I get the following error:
I get the following error from the SQL Script I am trying to run:
Why do I always get the following error from Postgres? syntax error at or
I get the following error coming from my Linq query: ExecuteReader requires an open
I get following error when trying to access Xampp from a network I've tried
I get the following error when inserting data from mysql into postgres. Do I
I get the following error when trying to push changes to github from the
When I reverse engineer from a Progress 9.1e database I get the following error
When I try to run the following, I get an error back from ActiveRecord

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.