Slt;Je compile avec VC++ 6 Std Ed et à chaque fois j'ai une erreur de l'exe . j'ai ezssayer avec plusieurs variantes ; mettre tt dans le main ; mais rien a faire ça plante toujours et encore , un coup de main , ou regarder si ca tourne bien , j'ai essayer sur 2pc pr voir , thk
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include <iostream>
#include <conio.h>
#include <string.h>
using namespace std;
#define PORTADDRESS 0x378 /* Enter Your Port Address Here */
#define DATA PORTADDRESS+0
#define STATUS PORTADDRESS+1
#define CONTROL PORTADDRESS+2
void _outp();
void _sleep();
void initialisation();
void send_texte();
void main()
{
char choix;
char quitter;
quitter = 'N';
do
{
/* Register Select must be connected to Select Printer (PIN 17) */
/* Enable must be connected to Strobe (PIN1) */
cout<<"\n a) Terminer le programme";
cout<<"\n b) INITIALISATION";
cout<<"\n c) TEXTE";
cout<<"\n\nAppuyer sur la touche de votre choix suivie de ENTER :";
cin>>choix;
switch(choix) //choix des options
{
case 'a' :
quitter= 'O';
break;
case 'b' :
initialisation();
break;
case 'c' :
send_texte();
break;
default: cout<<"\n\nVous n'avez pas entr\202 un choix valide.\n\n";
}
}
while(quitter == 'N');
cout<<"\n\nLe programme est termin\202.\n\n";
}
void initialisation()
{
int init[7] = {0x38,0x38,0x38,0x38,0x0C,0x07,0x01}; /* clear -return home-funtionset8b-Display Control-Entry Mode Set*/
_outp(CONTROL,0x00); /* Set Select Printer (Register Select) */
for (int count = 0; count < 7; count++)
{
_outp(DATA, init[count]);
_outp(CONTROL,0x01); /* Set Strobe (Enable)*/
_sleep(20); /* Larger Delay for INIT */
_outp(CONTROL,0x00); /* Reset Strobe (Enable)*/
_sleep(20); /* Larger Delay for INIT */
}
}
void send_texte()
{
char text[24] = {"Testing 1,2,3""magikila"};
int len= strlen(text);
_outp(CONTROL,0x08); /* Reset Select Printer (Register Select) */
for (int count = 0; count < len; count++)
{
cout << text[count];
_outp(DATA, text[count]);
_outp(CONTROL,0x09); /* Set Strobe */
_sleep(2);
_outp(CONTROL,0x08); /* Reset Strobe */
_sleep(2);
}
}