Not enough space for environment - Windows NT

This is a discussion on Not enough space for environment - Windows NT ; Hello, I have a 16 bit Program (VC 1.52) which at startup reports the error "Not enough space for environment" when started on Windows NT. On Windows 2000 the application does not report any erroe message but immediately exits. The ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Not enough space for environment

  1. Not enough space for environment

    Hello,

    I have a 16 bit Program (VC 1.52) which at startup reports
    the error "Not enough space for environment" when started on
    Windows NT. On Windows 2000 the application does not report
    any erroe message but immediately exits.

    The problem can be resolved by deleting some environment variables,
    but this is not a solution for my case (I have no control about the number
    of environment variables used by a customer). After digging around in the
    startup code, it seems to me that the error occures when InitTask() is
    called.
    Strange is that InitTask() does not return, the application will be
    terminated,
    thus I have no chance to change the startup code in a way to avoid that
    error.

    Any suggestions?? The following things I have tried already:
    * shrink the stack size - no effect
    * shrink the number of static text (DGROUP) - no help, could it be that
    there is a treshold for this one??
    * enlarge the heap size at startup - no help
    * replace the _setenvp() function with one that does nothing - no help
    because the error occures before _setenvp() is called in the startup
    code.

    Thanks in advance,
    GeH, Germany

  2. Re: Not enough space for environment

    Set a global environmental variable like so:

    comspec=c:\winnt\system32\cmd.exe /e:2048

    This should work both for WinNT & Win2000.

    wrote in message
    news:c4755454.0307210304.1de16eb3@posting.google.c om...
    > Hello,
    >
    > I have a 16 bit Program (VC 1.52) which at startup reports
    > the error "Not enough space for environment" when started on
    > Windows NT. On Windows 2000 the application does not report
    > any erroe message but immediately exits.
    >
    > The problem can be resolved by deleting some environment variables,
    > but this is not a solution for my case (I have no control about the number
    > of environment variables used by a customer). After digging around in the
    > startup code, it seems to me that the error occures when InitTask() is
    > called.
    > Strange is that InitTask() does not return, the application will be
    > terminated,
    > thus I have no chance to change the startup code in a way to avoid that
    > error.
    >
    > Any suggestions?? The following things I have tried already:
    > * shrink the stack size - no effect
    > * shrink the number of static text (DGROUP) - no help, could it be that
    > there is a treshold for this one??
    > * enlarge the heap size at startup - no help
    > * replace the _setenvp() function with one that does nothing - no help
    > because the error occures before _setenvp() is called in the startup
    > code.
    >
    > Thanks in advance,
    > GeH, Germany




+ Reply to Thread