BP7 protected mode chain to another program 
Author Message
 BP7 protected mode chain to another program

Any ideas on how to chain to another program in a BP7 protected mode
program? I am using Turbopower's CHAIN.PAS (v6.00) in a real mode
program but this chain.pas will not operate in protected mode. I guess
I could stuff the keyboard buffer but this seems hokey??

Thanks
Martin



Wed, 18 Jun 1902 08:00:00 GMT  
 BP7 protected mode chain to another program

Quote:

>Any ideas on how to chain to another program in a BP7 protected mode
>program? I am using Turbopower's CHAIN.PAS (v6.00) in a real mode
>program but this chain.pas will not operate in protected mode. I guess
>I could stuff the keyboard buffer but this seems hokey??

DOS already has method for that. It is called a batch file. You can
use halt() with parameters and then check the errorlevel to decide
correct action after the first program, or you could create files. For
example the program could create a bat-file that is executed with call
after the program has exited.

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 BP7 protected mode chain to another program
This is fine if you start your program from a batch file, but what if
you dont?  How do you tell the program to start running a batch file
(or .EXE) ?

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Wed, 18 Jun 1902 08:00:00 GMT  
 BP7 protected mode chain to another program

Quote:

>This is fine if you start your program from a batch file, but what if
>you dont?

And what if you instead start FDISK? There are wrong ways to use a
computer. I do not see the point in your question. If you use the
bat-file approach, you should not start the exe directly. period.

You could set an environment variable in the bat-file and then check for
it and it it is not there, format the hard disk. That will teach the user
to star the program properly :-)

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 BP7 protected mode chain to another program
Well I just wouldn't start FDISK. The end user is not be in control of
what program gets started since it is embedded in the source code.

My situation is I have a large EXE program as part of a suite of
programs, and I just want to jump from one module to another.
Turbopower's Chain.pas did it perfectly but it doesn't work in
protected mode. I can't use halt() and batch files since that would
require I start the main EXE with a batch file, and that is not always
the case.

Martin

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Wed, 18 Jun 1902 08:00:00 GMT  
 BP7 protected mode chain to another program

Quote:

>Well I just wouldn't start FDISK. The end user is not be in control of
>what program gets started since it is embedded in the source code.

>My situation is I have a large EXE program as part of a suite of
>programs, and I just want to jump from one module to another.
>Turbopower's Chain.pas did it perfectly but it doesn't work in
>protected mode. I can't use halt() and batch files since that would
>require I start the main EXE with a batch file, and that is not always
>the case.

You can make it so that it is always the case. Just as you can be in
front of your computer and not type FDISK, you can refrain from typing
the name of the EXE-file

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 BP7 protected mode chain to another program
On Fri, 07 Jan 2000 09:24:49 -0800, Martin_TVL

Quote:

>My situation is I have a large EXE program as part of a suite of
>programs, and I just want to jump from one module to another.
>Turbopower's Chain.pas did it perfectly but it doesn't work in
>protected mode. I can't use halt() and batch files since that would
>require I start the main EXE with a batch file, and that is not always
>the case.

What about a small dispatch main program which executes the modules in
a loop. Each module writes into a file the next module to be executed
and the command line. Here's a scetch of the code.

{$A+,B-,D+,E-,F+,G+,I+,L+,N-,P-,Q-,R+,S+,T+,V+,X-,Y+}
{$M $1000,0,0}   {Omit second 0 if protected mode}

program dispatch;

uses dos;

var
  modul, args: string;
  df: text;
begin
  repeat
    assign(df, 'dispatch.dat');
    reset(df);
    if ioresult<>0 then halt;
    readln(df, modul);
    if (ioresult<>0) or (modul='') then halt;
    readln(df, args);
    if ioresult<>0 then args := '';
    close(df);
    if ioresult<>0 then halt;
    erase(df);
    if ioresult<>0 then halt;
    swapvectors;
    exec(modul, args);
    swapvectors;
  until false;
end.
--
In order to e-mail me a reply to this message, you will have
to remove PLEASE.REMOVE from the address shown in the header.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Chaining to timer interrupt from protected mode

2. Unexpected heap overflow in protected mode program compiled by BP7

3. BP7: DLL in DOS protected mode program

4. program tracing in BP7, protected mode

5. BP7 + Protected mode apps + Windows 95/98 = slowdown

6. BP7 Protected Mode Problems

7. Allocating memory under protected mode (BP7)

8. Protected Mode and DMA with BP7

9. PLEEEEEASE Help - Pentium II and protected mode BP7

10. Windows NT4 + protected mode BP7 = problems ?

11. BP7-Protected Mode and P6 200Mhz machines

12. BP7 Protected mode crashes

 

 
Powered by phpBB® Forum Software