|
-
Aug 11th, 2000, 01:22 PM
#1
Thread Starter
Frenzied Member
I am beginner at C++, and I have a few problems with the BGI!
I have tried the following code:
Code:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* request autodetection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy, i;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
/* 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 */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
/* loop through the fill patterns */
for (i=EMPTY_FILL; i<USER_FILL; i++) {
/* set the fill style */
setfillstyle(i, getmaxcolor());
/* draw the 3-d bar */
bar3d(midx-50, midy-50, midx+50, midy+50, 10, 1);
getch();
}
/* clean up */
closegraph();
return 0;
}
But I get the following error:
Graphics error: Device driver file not found (EVAVGA.BGI)
Press any key to halt:
But I have checked my C:\bc45\bgi\ dir, and I found the EVAVGA.BGI file there!!!???
Whats wrong!!!???
[Edited by CyberCarsten on 08-11-2000 at 02:24 PM]
-
Aug 11th, 2000, 05:57 PM
#2
Monday Morning Lunatic
Is the BGI dir in your %PATH%?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 12th, 2000, 05:02 AM
#3
Thread Starter
Frenzied Member
What do your mean by %PATH% ??
-
Aug 12th, 2000, 06:58 AM
#4
Monday Morning Lunatic
It's an environment variable. Open up a console window, and type "set" (without the quotes). A list of environment variables will be displayed, and there should be a PATH entry there. %PATH% is the syntax for referencing the contents.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 12th, 2000, 07:47 AM
#5
Thread Starter
Frenzied Member
I dont know what this means....I'm new to C++
-
Aug 12th, 2000, 07:51 AM
#6
Monday Morning Lunatic
This isn't C++, it's basic DOS stuff. Did you never use DOS?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 12th, 2000, 07:57 AM
#7
Thread Starter
Frenzied Member
-
Aug 12th, 2000, 08:01 AM
#8
Monday Morning Lunatic
Naturally. Anyway, quick fix time. Open up a console window, and navigate to the folder with your app in. Then type:
Code:
SET PATH=%PATH%;C:\BC45\BGI
Then run your program.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 12th, 2000, 09:01 AM
#9
Thread Starter
Frenzied Member
Thank you!! I'll try that!!
-
Aug 12th, 2000, 09:03 AM
#10
Thread Starter
Frenzied Member
It still doesn't work....
-
Aug 12th, 2000, 09:07 AM
#11
Monday Morning Lunatic
Hmmmmmmmmm. Do any drivers need to be loaded at startup for it to work?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 12th, 2000, 09:14 AM
#12
Thread Starter
Frenzied Member
I dont't know....it was a sample program, I found in the help file...
-
Aug 12th, 2000, 09:18 AM
#13
Monday Morning Lunatic
Oh yeah, it's the dodgy Borland sample apps. Few of the ones I tried actually worked . Try copying the driver files to your c:\windows\command folder.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 12th, 2000, 09:24 AM
#14
Thread Starter
Frenzied Member
I'm running Win 2000 Pro, and I tried to copy the files in \BC45\BGI to the C:\winnt\system32 dir, but it didn't work...
-
Aug 12th, 2000, 03:02 PM
#15
Monday Morning Lunatic
Win2000...this changes everything. Win2000 is based on NT and as such blocks off direct hardware access, so I doubt that your program will be able to do anything. Most graphics under Win2K has to be done through DirectX or another Microsoft-certified method.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 12th, 2000, 03:44 PM
#16
Thread Starter
Frenzied Member
Ok, thanks any way! )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|