Click here to Skip to main content
15,929,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLCP Echo-Request on Windows Pin
Hideraldo Bernardo17-Mar-06 2:48
Hideraldo Bernardo17-Mar-06 2:48 
QuestionThreads, DLL Pin
miramarmisiones17-Mar-06 2:13
miramarmisiones17-Mar-06 2:13 
QuestionAcessing excel (*.xls) in vc++ Pin
chetan21018317-Mar-06 2:12
chetan21018317-Mar-06 2:12 
AnswerRe: Acessing excel (*.xls) in vc++ Pin
FarPointer17-Mar-06 4:04
FarPointer17-Mar-06 4:04 
GeneralRe: Acessing excel (*.xls) in vc++ Pin
chetan21018317-Mar-06 4:11
chetan21018317-Mar-06 4:11 
AnswerRe: Acessing excel (*.xls) in vc++ Pin
Hamid_RT17-Mar-06 4:06
Hamid_RT17-Mar-06 4:06 
GeneralRe: Acessing excel (*.xls) in vc++ Pin
chetan21018317-Mar-06 4:13
chetan21018317-Mar-06 4:13 
QuestionA problem related to parallel port programming Pin
rohinimtech17-Mar-06 1:10
rohinimtech17-Mar-06 1:10 
Hello friends

I have written a code in c++ for parallel port reading .
Programm is running successfully.
A analog to digital converter is attached to parallel printer port using 25 pin.
one side this ADC is attached to a device which gives analog voltages.
Following programm read the voltages pulses and print their values.
But I am not able to run this programm in VC++
I using conio.h and _outp _inp.
I have to run this programm using MDI application only,not dialog based.
plz suggest me where should I write the code ,what modification should I made in the following programm.
How is parallel port programming work in VC++(MDI app only)
void CStartport2View::OnDraw(CDC* pDC)
{
CStartport2Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

CString ms,ms1;

unsigned char a; int j,i,c; float voltage;

while(1)
{
c=0;
_outp(0x378,2);
_outp(0x378,0);
_outp(0x378,2);

for(j=0;j<5000;j++);

for(j=0;j<16;j++);
{
_outp(0x378,3);

for(i=0;i<5000;i++);

_outp(0x378,2);

for(i=0;i<5000;i++);a = _inp(0x379);

a=a&0x8; a=a>>3;
a=a&0x1; c= c*2; c=c|a;
}

ms.Format("%d",c);

pDC->TextOut(50,50,ms);

getch();
voltage = (5000.*c)/4096;

ms1.Format("%f",voltage);


ms1 = ms1.Mid(0,ms1.Find('.')+3);

pDC->TextOut(50,100,ms1);
}
Any help would be appreciated

rohini sharma
AnswerRe: A problem related to parallel port programming Pin
khan++17-Mar-06 1:18
khan++17-Mar-06 1:18 
GeneralRe: A problem related to parallel port programming Pin
rohinimtech19-Mar-06 18:14
rohinimtech19-Mar-06 18:14 
GeneralRe: A problem related to parallel port programming Pin
namaskaaram17-Mar-06 2:13
namaskaaram17-Mar-06 2:13 
GeneralRe: A problem related to parallel port programming Pin
rohinimtech19-Mar-06 18:12
rohinimtech19-Mar-06 18:12 
AnswerRe: A problem related to parallel port programming Pin
69 Bay17-Mar-06 2:39
69 Bay17-Mar-06 2:39 
QuestionHow does he do that?!! Pin
Diagon Alley17-Mar-06 0:49
Diagon Alley17-Mar-06 0:49 
AnswerRe: How does he do that?!! Pin
Karim Mribti17-Mar-06 0:54
Karim Mribti17-Mar-06 0:54 
AnswerRe: How does he do that?!! Pin
Ștefan-Mihai MOGA17-Mar-06 2:23
professionalȘtefan-Mihai MOGA17-Mar-06 2:23 
AnswerRe: How does he do that?!! Pin
Diagon Alley10-Apr-06 8:46
Diagon Alley10-Apr-06 8:46 
Questionhow to check machine offline or online Pin
baldha rakesh17-Mar-06 0:36
baldha rakesh17-Mar-06 0:36 
AnswerRe: how to check machine offline or online Pin
ThatsAlok17-Mar-06 0:56
ThatsAlok17-Mar-06 0:56 
QuestionTCP Pin
viliam17-Mar-06 0:33
viliam17-Mar-06 0:33 
Questionloading VC++ Component in a web page Pin
gayatri.b17-Mar-06 0:20
gayatri.b17-Mar-06 0:20 
QuestionHow to display XP Style buttons using VC++6.0? Pin
K. narasimharao17-Mar-06 0:10
K. narasimharao17-Mar-06 0:10 
AnswerRe: How to display XP Style buttons using VC++6.0? Pin
Naveen17-Mar-06 0:34
Naveen17-Mar-06 0:34 
AnswerRe: How to display XP Style buttons using VC++6.0? Pin
ThatsAlok17-Mar-06 0:35
ThatsAlok17-Mar-06 0:35 
AnswerRe: How to display XP Style buttons using VC++6.0? Pin
Hamid_RT17-Mar-06 1:00
Hamid_RT17-Mar-06 1:00 

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.