Running a PIF file using CreateProcess in an allocated console window - Programmer

This is a discussion on Running a PIF file using CreateProcess in an allocated console window - Programmer ; Hello, I am trying to find a way to execute a pif file within the context of my own application's console using AllocConsole. My basic need is to have the console in my context so I can use the console ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Running a PIF file using CreateProcess in an allocated console window

  1. Running a PIF file using CreateProcess in an allocated console window

    Hello,

    I am trying to find a way to execute a pif file within the context of
    my own application's console using AllocConsole.

    My basic need is to have the console in my context so I can use the
    console API's AND I must use the pif parameters for EMS, XMS, and a
    few other parameters.

    Is there a way to do this ? Is there a way around ?

    For example, try running "start /b XX.pif"

    I am getting an error message

    The NTVDM CPU has encountered an illegal instruction.
    and get the Close Ignore buttons.

    This is not related to any problems in the DOS application.

    If I use CREATE_NEW_CONSOLE in the creation flags, ofcourse everything
    works,
    but it is open in a new window. in the allocated console window I
    always get this GPF.

    Is there a way to get the console window in my context after the OS
    created it ?

    I can change _default.pif and just execute cmd.exe but I do not want
    to be dependant on _default.pif because of multiple executions issue.
    _default.pif is is hardcoded into ntvdm.exe.
    How can I allocconsole, run CMD with PIF settings ? and no
    _default.pif?

    Help ?

    Thanks for your time,

    Ran.

  2. Re: Running a PIF file using CreateProcess in an allocated console window


    "Ran" wrote in message
    news:2d73b65b.0404260610.785d48fe@posting.google.c om...
    > Hello,
    >
    > I am trying to find a way to execute a pif file within the context of
    > my own application's console using AllocConsole.


    I don't think I understand what you're trying to do. You can't run a
    program using AllocConsole. All it will do for you is create a console and
    attach it to your GUI program and calling it from a console program will
    fail.

    > My basic need is to have the console in my context so I can use the
    > console API's AND I must use the pif parameters for EMS, XMS, and a
    > few other parameters.
    >
    > Is there a way to do this ? Is there a way around ?
    >
    > For example, try running "start /b XX.pif"
    >
    > I am getting an error message
    >
    > The NTVDM CPU has encountered an illegal instruction.
    > and get the Close Ignore buttons.
    >
    > This is not related to any problems in the DOS application.


    Are you executing this START command from a CMD prompt? If not, what
    happens if you do?

    > If I use CREATE_NEW_CONSOLE in the creation flags, ofcourse everything
    > works,
    > but it is open in a new window. in the allocated console window I
    > always get this GPF.
    >
    > Is there a way to get the console window in my context after the OS
    > created it ?


    Not really.

    > I can change _default.pif and just execute cmd.exe but I do not want
    > to be dependant on _default.pif because of multiple executions issue.
    > _default.pif is is hardcoded into ntvdm.exe.
    > How can I allocconsole, run CMD with PIF settings ? and no
    > _default.pif?


    If you can create a PIF which you can successfully run from a CMD
    prompt, you should also be able to run it from your console program.

    --
    -GJC [MS Windows SDK MVP]
    -Software Consultant (Embedded systems and Real Time Controls)
    - http://www.mvps.org/ArcaneIncantations/consulting.htm
    -gchanson@mvps.org


+ Reply to Thread