Click here to Skip to main content
15,897,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMSChart in VC++2005 Pin
hahahua28-Apr-07 10:38
hahahua28-Apr-07 10:38 
AnswerRe: MSChart in VC++2005 Pin
hahahua28-Apr-07 16:57
hahahua28-Apr-07 16:57 
AnswerRe: MSChart in VC++2005 Pin
Joan M28-Apr-07 23:50
professionalJoan M28-Apr-07 23:50 
GeneralRe: MSChart in VC++2005 Pin
hahahua29-Apr-07 8:40
hahahua29-Apr-07 8:40 
GeneralRe: MSChart in VC++2005 Pin
Joan M29-Apr-07 8:46
professionalJoan M29-Apr-07 8:46 
GeneralRe: MSChart in VC++2005 Pin
hahahua30-Apr-07 15:33
hahahua30-Apr-07 15:33 
GeneralRe: MSChart in VC++2005 Pin
Joan M30-Apr-07 22:28
professionalJoan M30-Apr-07 22:28 
Questionhi guys,i'm in a fix and need help Pin
phemmymichael28-Apr-07 9:02
phemmymichael28-Apr-07 9:02 
I have a c++ codes for programming the parallel port to control an interfce circuit of 8 electrical devices.But this code did not work on WIN XP.how can convert these codes to visual c++ in order for me to incorporate inpout32.dll.Thanks
this is the code:
/*program to control devices using PC parallel port
The devices are controlled by pressing the keys 1-8
that corresponds to each of the 8 possible devices
*/

#include<dos.h>
#include<stdio.h>
#include<conio.h>
#define PORT 0x378 /* This is the parallel port address */

main()
{
char val=0,key=0;
char str1[]="ON ";
char str2[]="OFF";
char *str;
clrscr();
printf("Press the approriate number key to turn on/off devices:\n\n");
printf("Here Device1 is connected to D0 of parallel port and so on\n\n");
printf("Press \"x\" to quit\n\n");
gotoxy(1,8);
printf("Device1:OFF Device2:OFF Device3:OFF Device4:OFF\n");
printf("Device5:OFF Device6:OFF Device7:OFF Device8:OFF");

while(key!='x' && key!='X')
{
gotoxy(1,12);
printf("Value in hex sent to the port:");
key=getch();
switch(key){

case '1':

gotoxy(9,8);
val=(val&0x01)?(val&(~0x01)):val|0x01;
str=(val&0x01)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '2':

gotoxy(21,8);
val=(val&0x02)?(val&(~0x02)):val|0x02;
str=(val&0x02)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '3':

gotoxy(33,8);
val=(val&0x04)?(val&(~0x04)):val|0x04;
str=(val&0x04)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '4':

gotoxy(45,8);
val=(val&0x08)?(val&(~0x08)):val|0x08;
str=(val&0x08)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '5':

gotoxy(9,9);
val=(val&0x10)?(val&(~0x10)):val|0x10;
str=(val&0x10)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '6':

gotoxy(21,9);
val=(val&0x20)?(val&(~0x20)):val|0x20;
str=(val&0x20)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '7':

gotoxy(33,9);
val=(val&0x40)?(val&(~0x40)):val|0x40;
str=(val&0x40)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",val);
break;

case '8':
gotoxy(45,9);
val=(val&0x80)?(val&(~0x80)):val|0x80;
str=(val&0x80)?str1:str2;
printf("%s",str);
outportb(PORT,val);
gotoxy(1,13);
printf("%x",(unsigned char)val);
break;

}

}


}
AnswerRe: hi guys,i'm in a fix and need help Pin
John R. Shaw28-Apr-07 14:52
John R. Shaw28-Apr-07 14:52 
GeneralRe: hi guys,i'm in a fix and need help Pin
Randor 28-Apr-07 21:54
professional Randor 28-Apr-07 21:54 
Questionconversion from wave to mp3 Pin
puneet_cha28-Apr-07 8:55
puneet_cha28-Apr-07 8:55 
AnswerRe: conversion from wave to mp3 Pin
Mark Salsbery29-Apr-07 8:39
Mark Salsbery29-Apr-07 8:39 
QuestionPlaySound VC++ 2003 MFC Pin
YUANGE28-Apr-07 8:45
YUANGE28-Apr-07 8:45 
AnswerRe: PlaySound VC++ 2003 MFC Pin
Hamid_RT28-Apr-07 8:50
Hamid_RT28-Apr-07 8:50 
AnswerRe: PlaySound VC++ 2003 MFC Pin
YUANGE29-Apr-07 1:56
YUANGE29-Apr-07 1:56 
QuestionHooking & modifying WSARec Pin
Dody_DK28-Apr-07 8:12
Dody_DK28-Apr-07 8:12 
QuestionClosing extern processes Pin
HorrorVision28-Apr-07 6:39
HorrorVision28-Apr-07 6:39 
AnswerRe: Closing extern processes Pin
bob1697228-Apr-07 7:54
bob1697228-Apr-07 7:54 
GeneralRe: Closing extern processes Pin
HorrorVision28-Apr-07 8:25
HorrorVision28-Apr-07 8:25 
GeneralRe: Closing extern processes Pin
Hamid_RT28-Apr-07 9:45
Hamid_RT28-Apr-07 9:45 
GeneralRe: Closing extern processes Pin
HorrorVision28-Apr-07 11:06
HorrorVision28-Apr-07 11:06 
GeneralRe: Closing extern processes Pin
bob1697228-Apr-07 12:19
bob1697228-Apr-07 12:19 
AnswerRe: Closing extern processes Pin
Mark Salsbery29-Apr-07 8:47
Mark Salsbery29-Apr-07 8:47 
QuestionChange the color of a checkbox Pin
Joan M28-Apr-07 5:52
professionalJoan M28-Apr-07 5:52 
AnswerRe: Change the color of a checkbox Pin
PJ Arends28-Apr-07 6:14
professionalPJ Arends28-Apr-07 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.