Error:Unhandled exception while compiling the program
-
13 Maret 2012 11:35
hi,
here in this below simple program am trying to compile and which giving an unhandled exception.want to know whether the _outp(),_inp() functions will work for windowsxp operating system.If so,then why am getting the unhandled exception.I would like to check the low and high on the particular pins of parallel port from C program.could u please give me an example to do this way of interfacing with the parallel port in C.
include "stdafx.h"
#define PORT1 0x378int _inp(unsigned short port);
int _outp( unsigned short port, int databyte );int main () {
int val = 0;
short result;while ( val < 256) {
printf("Enter a value in decimal (256 to quit)>");
scanf("%d", &val);
//_outp(PORT1, val);
result=_inp(PORT1);
printf("the result value:%d",result);
}_outp(PORT1, 0);
return 0;
}I checked the outportb(); function which doesnot allow at all.compiler am using is visual studio 2008.kindly suggest any tutorial links to learn the complete parallel port interfacing in C or C++
Semua Balasan
-
13 Maret 2012 12:29
keerth516 wrote:
want to know whether the _outp(),_inp() functions will work for windowsxp operating system.
No they won't. User-space programs aren't allowed direct access to I/O ports. You need a kernel-mode device driver for that.
kindly suggest any tutorial
links to learn the complete parallel port interfacing in C or C++http://logix4u.net/parallel-port/16-inpout32dll-for-windows-982000ntxp
Igor Tandetnik
- Disarankan sebagai Jawaban oleh Helen ZhaoModerator 15 Maret 2012 2:22
- Ditandai sebagai Jawaban oleh Helen ZhaoModerator 20 Maret 2012 1:21