PRB: CreateProcess() of Windows-Based Application Fails

Last reviewed: September 25, 1995
Article ID: Q127860
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT version 3.5
    

SYMPTOMS

When you spawn a 16-bit Windows-based application using CreateProcess() where neither lpApplicationName and lpCommandLine are NULL, WOW gives a popup saying:

   Cannot find file (or one of its components). Check to ensure the path
   and filename are correct and that all required libraries are available.

CAUSE

NTVDM expects the first token in the command line (lpCommandLine) to be the program name, although the Win32 subsystem does not. The current design will not be changed.

RESOLUTION

Make lpApplicationName NULL and put the full command line in lpCommandLine.

STATUS

This behavior is by design.

MORE INFORMATION

The documentation for CreateProcess() states:

   If the process to be created is an MS-DOS-based or Windows-based
   application, lpCommandLine should be a full command line in which
   the first element is the application name.

In this case (lpApplicationName is not NULL), lpCommandLine not only should be a full command line, but it must be a full command line.


Additional reference words: 3.50
KBCategory: kbprg kbprb
KBSubcategory: BseProcThrd


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 25, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.