-
new to borland/get error
i just got Borland
and wrote this code which is meant to be used with
turbo c++
i got borland 5.0
Code:
/*initgraph example a simple program to demonstrate the init graph and draw a line
from on diagonal of the screen to the other*/
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
/* initialize graphics mode */
initgraph(&gdriver, &gmode, "C:\\tc\\bgi");// yes i
//changed
//this to my borland bgi folder
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occured */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* return with error code */
}
/* draw a line from (0,0) to (max X, max Y)*/
int x=getmaxx()/2, y=getmaxy()/2;
bar(x-10,y-10,x+10,y+10);
/* clean up*/
getch();
getch();
/* two getch() needed as characters will carry through the buffer some
keystrokes can carry through the buffer*/
closegraph();
return 0;
// i get error saying BGI graphics not supported under windows
//thanks in advance
-
there are two possibilites here
1. borland no longer supports graphics on windows
2. your using an incompatible version on windows.
more likely 1 but,
what version of windows are you using?
-
-
try running your program directly in compatibility mode for Win95 or 98
-
-
navigate to the your programs exe in explorer right click on your .exe select properties at the bottom of the menu click the compatibility tab go to the compatibility mode area click the check box on "Run this program in compatibility for:" and select the appropriate OS.
-
i dont have the turbo c++
i use borland c++ 5.0
anyone know what i should do to mke it work?
-