Solved

DPMILOAD.EXE ??

Posted on 1998-12-02
12
2,192 Views
Last Modified: 2008-02-20
Hi,
When I compile program in Win98 DOS section or pure MS-DOS 6.0, I got a error message "Failed to locate protected mode loader (DPMILOAD.EXE)".
All I have to do is to get one? Or anything else?
I search on internet, all are patch document.
Any one can send one to me!
Thanks.

Lin Wei-Chang
william@ellcon.com.tw
0
Comment
Question by:ginaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 10

Expert Comment

by:rbr
ID: 1254774
Which compiler to you use?
0
 

Author Comment

by:ginaa
ID: 1254775
Oh, I use djgpp\gcc to compile.
Is these any difference?

Lin

0
 

Author Comment

by:ginaa
ID: 1254776
Oh, by the way, my company compile it in Win95 OSR2 version'
DOS section and never has his problem.
And I can't find the program "dpmiload.exe" in his computer, why?

Lin
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ginaa
ID: 1254777
Oh, by the way, my company compile it in Win95 OSR2 version'
DOS section and never has his problem.
And I can't find the program "dpmiload.exe" in his computer, why?

Lin
0
 

Author Comment

by:ginaa
ID: 1254778
I got it, I get a djgpp' make.exe, then there is no problem any more.
But if has any other solution, I still wait.
Now I have another question.
When I compile program, the message are too many, and scroll too fast. I press pause or direct to a file won't work. So I can't see all the compile message, help !!

lin

0
 

Expert Comment

by:bflVijay
ID: 1254779
Hi,
    Doesn't the pipe (|) work either?
0
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 1254780
Concerning your messages scrolling of screen:
Under dos, the command.com interpreter does not allow you to specify redirection for anything else that stdin and stdout (or file descriptors 0 and 1).  Your messages are probably send to stderr (file descriptor 2).  This is a limit in the syntax accepted by the command line interpreter, not in the os itself.
You could use a 'program shell', a small c program that will setup the redirection and then exec's your program.  This program will inherit the open filedescriptors, and voila.
I suppose Win98 still uses this limited command interpreter.
If you want, I can post the old dos program code for such a shell I once wrote.  However, I can not and will not guarantee that it will work the same under Win98.
0
 

Author Comment

by:ginaa
ID: 1254781
That will be fine.
Thank you
Or you can mail to me
william@ellcon.com.tw

0
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 1254782
/*===========================================================================
Application: BVREDIRF
Module     : BVREDIRF

Description:
  - DOS 'shell' program to redirect all standard C streams to disk files

Author     : Bert Vermeerbergen

Version    : V1.0  27/11/94
               Redirect the 5 standard C streams and run program supplied as
               argument.
===========================================================================*/

#include "stdlib.h"
#include "stdio.h"
#include "direct.h"
#include "io.h"
#include "string.h"
#include "process.h"
#include "assert.h"

/*-------------------------------------------------------------------------*/

#define About(ver)  { char szProg[_MAX_FNAME]; \
    _splitpath(argv[0], NULL, NULL, szProg, NULL); \
    fprintf(stderr, "%s  " #ver "  (c) '94 Bert Vermeerbergen\n", szProg); }

/*-------------------------------------------------------------------------*/

struct _redirFile {
    char szName[_MAX_FNAME];      //-- redirection filename
    int  nDupHandle;                  //-- original stream handle
    FILE *pfRedir;                        //-- redirection stream
} redirFile [5];                        //-- indexed by handle

int  iDriveWork = 0;            //-- optional working drive
char szDirWork[_MAX_PATH];      //-- optional working directory to run in

/*-------------------------------------------------------------------------*/

void Help (char *pArg0)
{
    char szProg[_MAX_FNAME];

    _splitpath(pArg0, NULL, NULL, szProg, NULL);
    fprintf(stderr, "\nUsage: %s [/?] [/ioeap=filenname] [/@[drv:]dir] programname [arg...]\n", szProg);
    fprintf(stderr, "    Run program with standard C stream(s) redirected to disk file\n");
    fprintf(stderr, "\nOptions:\n");
    fprintf(stderr, "    /?              you're reading it now\n");
    fprintf(stderr, "    /i=inputfile    redirect stdin  (#0) stream\n");
    fprintf(stderr, "    /o=outputfile            stdout (#1)\n");
    fprintf(stderr, "    /e=errorfile             stderr (#2)\n");
    fprintf(stderr, "    /a=auxfile               stdaux (#3)\n");
    fprintf(stderr, "    /p=printerfile           stdprt (#4)\n");
    fprintf(stderr, "    /@[drv:]dir     working directory for program to run\n");
    fprintf(stderr, "    programname     filename of program to run\n");
    fprintf(stderr, "    arglist         arguments to program\n");

    exit(0);
}

/*-------------------------------------------------------------------------*/

char *GetOpt (char *pArgv)
{
    char ch1, ch2;

      if (!pArgv)
            return(NULL);

    ch1 = *pArgv;
    ch2 = (char)toupper(*(pArgv+1));
    if ((ch1 == '?') ||
            ((ch1 == '/') && ((ch2 == '?') || (ch2 == 'H'))) ||
            (stricmp(pArgv, "HELP") == 0))
    {
            pArgv[1] = '?';
            return(pArgv+1);
    }
    else if ((ch1 == '/') || (ch1 == '-'))
    {
            pArgv[1] = (char)toupper(pArgv[1]);
            return(pArgv+1);
    }
    else
    {
            return(NULL);      /* stop scan when no more options */
    }
}

/*-------------------------------------------------------------------------*/

int main (int argc, char **argv)
{
    int  nRslt, nf, nErr;
    int  nArg;
    int  nOptCnt;
    char *pszOpt;
    int  iDriveOld;
    char szDirOld[_MAX_PATH];

    /*-- show me --*/
    About(1.0);

    /*-- get user options --*/
    nOptCnt = 1;
    while ((pszOpt = GetOpt(argv[nOptCnt])) != NULL)
    {
        switch (pszOpt[0])
        {
          case '?':
                  Help(argv[0]);
                  break;

          case 'I':
          case 'O':
          case 'E':
          case 'A':
          case 'P':
            if ((pszOpt[1] == '=') && (pszOpt[2] != '\0'))
            {
                switch(pszOpt[0])
                {
                  case 'I': strcpy(redirFile[0].szName, &pszOpt[2]); break;
                  case 'O': strcpy(redirFile[1].szName, &pszOpt[2]); break;
                  case 'E': strcpy(redirFile[2].szName, &pszOpt[2]); break;
                  case 'A': strcpy(redirFile[3].szName, &pszOpt[2]); break;
                  case 'P': strcpy(redirFile[4].szName, &pszOpt[2]); break;
                  default:
                        fprintf(stderr, "Error in option %s, skipped\n", argv[nOptCnt]);
                }
            }
            else
                       fprintf(stderr, "Error in option %s, skipped\n", argv[nOptCnt]);
            break;

          case '@':
            if ((strlen(pszOpt) >= 3) && (pszOpt[2] == ':'))      //-- @c:xxx
            {
                iDriveWork = pszOpt[1] - 'A' + 1;
                strcpy(szDirWork, &pszOpt[3]);
            }    
            else                                            //-- @xxx
            {
                iDriveWork = 0;
                strcpy(szDirWork, &pszOpt[1]);      
            }
            break;

          default:
                     fprintf(stderr, "Unknown option %s, skipped\n", argv[nOptCnt]);
        }
        nOptCnt++;
    }

    //-- nOptCnt is # programname argument, is required
    if (!(nOptCnt < argc))
    {
            fprintf(stderr, "\nREQUIRED ARGUMENT programname MISSING\n");
            Help(argv[0]);
    }

    //-- redirect streams
    for (nf = 0; nf < 5; nf++)
    {
        if (redirFile[nf].szName[0] != '\0')      //-- filename given for stream #nf
        {
            //-- save handle of stream to be redirected to file
            redirFile[nf].nDupHandle = _dup(nf);
            //-- open redirection stream
            redirFile[nf].pfRedir = fopen(redirFile[nf].szName, (nf == 0 ? "rt" : "wt"));
                  assert(redirFile[nf].pfRedir != NULL);
                  //-- redirect filedescripter to new stream file    
                  nErr = _dup2(_fileno(redirFile[nf].pfRedir), nf);
                  assert(nErr == 0);
            }
    }

    //-- shift program argument list
    for (nArg = 0; nArg < argc - nOptCnt; nArg++)
    {
        argv[nArg] = argv[nArg+nOptCnt];
    }
    argv[nArg] = NULL;

    //-- save current working directory
    iDriveOld = _getdrive();
    _getcwd(szDirOld, sizeof(szDirOld));

    //-- change to specified working directory
    if (iDriveWork != 0)
        _chdrive(iDriveWork);
    if (szDirWork[0] != '\0')
        _chdir(szDirWork);
   
    //-- launch program using redirection
    nRslt = _spawnvp(_P_WAIT, argv[0], argv);

    //-- return to original working directory
    if (iDriveWork != 0)
        _chdrive(iDriveOld);
    if (szDirWork[0] != '\0')
        _chdir(szDirOld);
   
    //-- restore streams
    for (nf = 0; nf < 5; nf++)
    {
        if (redirFile[nf].szName[0] != '\0')      //-- filename given for stream #nf
        {
                  //-- flush buffers and close the redirection file
                  fflush(redirFile[nf].pfRedir);
                  fclose(redirFile[nf].pfRedir);
                  //-- restore original stream
                  nErr = _dup2(redirFile[nf].nDupHandle, nf);
                  assert(nErr == 0);
            }
    }

    //-- report if launch error
    if (nRslt < 0)
        fprintf(stderr, "spawn error %d: %s\n", nRslt, strerror(errno));

    return(0);
}

/*=========================================================================*/

0
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 1254783
Sorry for the indentation problems, these must be tab characters that are not used consistently.
Don't be alarmed by the size of the 'small' shell.  Most of the code concerns option handling.  The core starts around the lines:
    //-- redirect streams
    for (nf = 0; nf < 5; nf++)
       ...
in main()

It compiles and seems to work under Win95 (using Visual C++ 5.0) as a 32-bit console application.

Example of use:
  bvredirf /o=ttt /e=ttt2 xcopy /I x y
will create file ttt containing one line:
     0 file copied
and the file ttt2 containing the line:
  File not found - x
(Assuming of course that there was no file x to copy)

Please feel free to use and or modify it.
0
 
LVL 3

Accepted Solution

by:
matth012098 earned 100 total points
ID: 1254784
Hi ginaa

   Here is a site you can download DPMILOAD.EXE from

http://www.heim2.tu-clausthal.de/PROJEKT/PRG/PCGAMES/index-e.html

goto the bottom of the page and under the heading .EXE files you will find it

matth

0
 

Author Comment

by:ginaa
ID: 1254785
Though I don't need it any more, but you answer the origin question, so thank you any way

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question