I have been working on a console app for some time now, and it works perfectly in winXp. Yet, the problem is that when I took my .exe to school (they use windows98), I was astonished to find that it is kinda wrong in operation here...
Well ok, all the calculations seem alright, but the problem with when I run my app in win98, my color functions are not showing up right. It is mainly the problem whenever my program calls the color function that makes the background black. In win98, it fails to make the background black. Instead, it uses the same background color I defined before.
Now what can I do so everything in my console app works perfectly in win98. I am using microsoft visual express 2005 c++. And I am coding in C language.
Here is some code snippits on my key problems:
the color functions...
Code:void tdefault() { #ifdef WIN32 HANDLE hstdo; hstdo = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hstdo, FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); #endif }
A menu print function:
SCREENSHOT:Code:void main_menu() { tdefault();system("cls"); printf("\n\n\n\n\n\n\n\n\t\t\t ");face_menu_titlebar(); printf(" MENU: Main Menu \n");tdefault();printf("\t\t\t ");bdefault(); printf(" 1. New Campaign \n");tdefault();printf("\t\t\t ");bdefault(); printf(" 2. Options \n");tdefault();printf("\t\t\t ");bdefault(); printf(" 3. Exit \n");tdefault();printf("\t\t\t ");bdefault_i(); printf(" Type in # corresponding \n");tdefault();printf("\t\t\t ");bdefault_i(); printf(" to desired choice. \n");tdefault();printf("\t\t\t ");tdefault(); char main_menu_select = _getche(); if(main_menu_select=='1') {difficulty_select();} if(main_menu_select=='2') {menu_options();} if(main_menu_select=='3') {exit();} else main_menu(); }
Windows98 prints incorrectly!
http://img361.imageshack.us/img361/4065/12aj2.jpg