home *** CD-ROM | disk | FTP | other *** search
- /*====================================================================*/
- /* Sample program in C++ language to show files in CAP format. */
- /* By: Kuo Shiang Shiang (Djohan) & Jeng Shun Huo (Fire) */
- /* */
- /* Compiler : Turbo/Borland C++ V1.0 or later */
- /* Model : Huge */
- /* Project file : SAMPLECP.PRJ */
- /* C Library used : CAP.OBJ */
- /*====================================================================*/
- #include <iostream.h>
- #include <conio.h>
-
- extern "C" {int Show_CAP(char *);}
- extern "C" {void Set_Screen_Mode(int);}
-
- void main(void)
- {
- int error_code=0;
-
- error_code = Show_CAP("SAMPLE.CAP"); // Show "SAMPLE.CAP"
-
- if (error_code==0) getch(); // If no error, wait for a key
- Set_Screen_Mode(3); // Switch back to color text mode
-
- switch(error_code) {
- case 1: cout << "ERROR: The image file is not in CAP format!\7\n";
- break;
- case 2: cout << "ERROR: File I/O error or file not found!\7\n";
- break;
- case 3: cout << "ERROR: Not enough memory!\7\n";
- break;
- case 4: cout << "ERROR: This file can't be shown in Chinese system!\7\n";
- break;
- }
- }
-