hi all ;;
i'm so glade to join u ,,
i want ti ask about my problem in using borlandc++ 3.11 under windows vista home edition ,

i wrote the following program ..& i runs perfect on windows xp(on my desktop computer)
but while trying it on my laptop dell inispiron 1520 i get the following runtime error-
note .. i have checked graphics library in option/linker/libraries/graphic libraries.

(
borland c++ for dos
this system does not support fullscreen mode.choose 'close' to terminate the application.
                                                                      close      ignore

when i press ignore it comes again to me ,, when i press again - borland c++ hang

)

can anyone tell me how to fix this problem??
thanks in advance....
that include the following code:

#include <stdlib.h>
#include <stdio.h>
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
class point
{
int x;
int y;
static int pointnum;

public:
static int getpointnum()
    {
    return pointnum;
    }

int getx()
    {
    return x;
    }

int gety()
    {
    return y;
    }


void setx(int n)
    {
    x=n;
    }
void sety(int m)
    {
    y=m;
    }

point()
    {
    x=y=0;
    pointnum++;
    cout<<"def. con. point";
    }

point(int n,int m)
    {
    x=n;
    y=m;
    pointnum++;
    cout<<"con. point";
    }

~point()
    {
    pointnum--;
    cout<<"dest. point";
    }

};

class rect
{
int color;
point ul;
point lr;
static int rectnum;

public:
static int getrectnum()
    {
    return rectnum;
    }

rect():ul(),lr()
    {
    color=0;
    rectnum++;
    }

rect(int x1,int y1,int x2,int y2,int c):ul(x1,y1),lr(x2,y2)
    {
    color=c;
    rectnum++;
    }

~rect()
    {
    rectnum--;
    }

void draw()
    {
    setcolor(color);
    rectangle(ul.getx(),ul.gety(),lr.getx(),lr.gety());

    }
};

int rect::rectnum=0;
int point::pointnum=0;
void main()
{
/* request auto detection */
int gdriver =DETECT, gmode, errorcode;

/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "c:\\bcpp\\bgi");

/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk)  /* an error occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with an error code */
   }

rect r(200,300,400,500,5);
r.draw();
getch();
closegraph();
}

Dani AI

Generated

Old Borland C++ (the DOS-era 3.x toolchain and its BGI graphics) expects direct DOS/video hardware access. As pointed out, it’s a legacy tool; ’s remark about video-mode support is also relevant. Modern Windows (and many laptop video drivers) no longer allow that kind of low-level fullscreen access, so the runtime fails when the program tries to switch modes. Practical, reliable fixes:

Use DOSBox to emulate real DOS

mount c C:\path\to\borland
c:
cd \ (change into the compiler/IDE folder)
run the compiler/IDE executable from inside DOSBox

DOSBox emulates VGA/SVGA modes and will run Borland’s IDE and BGI graphics reliably on current Windows. Download: DOSBox.

Run a VM with a legacy OS
Create a virtual machine (VirtualBox/VMware), install a 32-bit Windows or DOS/Windows 98, install Borland there and run your projects exactly as on older hardware. This is the safest route when an instructor requires the original environment. VirtualBox: https://www.virtualbox.org/.

Port to modern tools (longer-term)
If the goal is learning C++ rather than preserving a DOS EXE, consider migrating away from graphics.h. Options include a Win32 BGI port or switching to modern libraries (SDL, SFML, plain Win32 GDI) and using an up-to-date IDE (Code::Blocks/MinGW). Links: SDL, Code::Blocks.

Notes: 64‑bit Windows does not run 16‑bit/DOS programs natively — use DOSBox/VM. If sticking with Borland for grading, prepare a VM image or a DOSBox package so the instructor can reproduce your results.

Recommended Answers

All 3 Replies

>borlandc++ 3.11 under windows vista home edition
You might as well ask about the coal driven steam engine in your Ferrari while you're at it.

Do you have a reason why you are running borland c++ 3.11??

I can tell you that the program will not run on a computer that has no clue what DOS stretch mode is .

hi guys,, thanks for replying but really i'm in stage of learning c++ .. and the instructor asked me to use borland c++ as it is the worst compiler to deal with .. so i'm forced to use it ...
i hope anyone help me ,, and find answer to my problem & also tell me about a good compiler to use it .. thank uzzzzzzzzzzzzzzzzzzzz

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.