Coatzacoalcos, Mexico to

PRINCIPAL

Home
Blog
Conferences
My Photography
Personal Gallery
Joke (Chistes)
Curriculum
Documentation
Contacts me

ARTICLES

Abstract PHP's code with PEAR::DB

Analogs of Windows Software in Linux

El evangelio de Tux (spanish)

Introduction to HTML_QuickForm

The Vi editor

Graphics with Turbo C++

The ftp manual

Installing the Apache Server

How to convert with Latex to PDF file

Configuring Samba.

A basic program in gtk+

OTHER ARTICLES

Introduction to Network security

How to Print Screen with yast.

The DNS Howto's

CONFERENCES

The Information Technology as competitive strategy for PyMEs.

The PHP Extension and Application Repository

A Tutorial for HTML_QuickForm

HTML_QuickForm

What is the impact of Free software in the Organizations and in the Goverment

Free software in the Government

Introduction to Linux

Database Security in MySQL

Stocastics Model for inundations

COURSES

GNU LINUX.
Administration and Configuration.
[See the Chapters]




Graphics with Turbo C++ in Wx.

The article explains the mode of distribute graphics applications in C++ without include the file EGAVGA.BGI and files of text's sources (.CHR) with the application. Will, now you will see that is very easy.

First is necessary convert the file: "EGAVGA.BGI" in a object file (.OBJ). We going to convert with the utility BGIOBJ.EXE, that is localized in the directory: C:\TC\BGI, you can write in the path:

C:\TC\BGI>BGIOBJ EGAVGA

If the file is done correctly, it should indicate the public name of Driver: AVGA_driver.

You imagine that the application will use the TRIPLEX source, then we going to convert so:

C:\TC\BGI>BGIOBJ TRIP

The public name of the source is: triplex_font.

Now we can to go at the directory in which is localized the program. Open The Turbo C/C++ and create a new project with the option: "Project\Open project....". We should indicate the name for the project. You remember that the name of FILE.EXE has that be similar at the project name.

Well, after then you should add the files that we need it. The mode is with the option: "Project\Add item...." You add the source of the application and the files: EGAVGA.OBJ and TRIP.OBJ.

Edit the code for initiate the mode graphic and add the next lines:

registerbgidriver(EGAVGA_driver); registerbgifont(triplex_font);

The code should to be similar at example:

#include "conio.h"
#include "graphics.h"
void main(void) {
            int tarjeta, modo, error;
           registerbgidriver(EGAVGA_driver);
            registerbgifont(triplex_font);

           detectgraph(&tarjeta, &modo);
            initgraph(&tarjeta, &modo, "");

            error = graphresult();
           if (error) {
                       printf("%s", grapherrormsg(error));
                      exit(1);
      }
// Draw a circle
fillellipse(200,200,20,20);
while (!kbhit());
}

Coment: Now, only play CTRL + F9 and compile the project. Note that you can distribute the application without include the aditional files ;-)


2005 - Farid A. Bielma Lopez

Home | Unix Mexico | El Demonio | OpenBSD | Ubuntu Guide
Internet.com | Barrapunto | Diario Linux | Unam - Cert | Securityfocus
Send me a mail.