Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

_outp _inp

Status
Not open for further replies.

speedo

Programmer
Aug 24, 2001
13
DE
Im using visual c++ 6,I want to use _outp and _inp to access the network card in order to send test ethernet frame (my application).
I declare <conio.h> but i always get an error!!

thanks for helping me
 
the error is that the _outp function is not declared!
 
check conio.h and make sure you have the right syntax. If you have the right syntax, you shouldn't get an undeclared error, unless the function doesn't exist in conio.h at all.
 
all seems to be ok but i still get the same error!!
conio.h exists,
it contains _outp,

 
try
#define _M_IX86 before #include<conio.h> John Fill
1c.bmp


ivfmd@mail.md
 
obviously, Johnfill is on the right track. It looks like something needs to be defined BEFORE you include conio.h If you look at conio.h there is probably an:

#ifdef

before the declaration of outp. Also don't use the '_' like I said above, it looks like there is an ansi version outp.
 
try also
#undef _INC_CONIO before icnluding. John Fill
1c.bmp


ivfmd@mail.md
 
OK hold up, are you getting an unresolved external symbol, or an undeclared identifier error. (ie is the error on the compile or link step)
 
Sorry, I was wrong about the '_' apparently it won't work without it. Anyhoo this code compiles and links without a probalem

#define M_IX86
#include <conio.h>

int main()
{

int one;
int two = 2;
unsigned short three = 3;

one = _outp(three,two);

}

have fun

 
By the way, conio is for console applications.
Try
_asm in ax, numport
_asm out numport, ax? John Fill
1c.bmp


ivfmd@mail.md
 
ok thanks!
but for windows applications which functions should i use to access hardwa
 
I don't know, but the level language instruction are better when you want something at lowlevel. John Fill
1c.bmp


ivfmd@mail.md
 
mfm, as I remember in and out are not the same as int (I mean there asm). John Fill
1c.bmp


ivfmd@mail.md
 
Hello all,

I also get errors when using _inp OR _outp. I'm running windows xp, VC++ 6. I'm trying to build a simple program that reads the data coming in through any given port but everytime I try to execute the code containing _inp or _outp, it stops the program and says: &quot;has encountered a problem and needs to close&quot;. Any thoughts as to why? It seems I've tried everything but can't seem to shake that error message. -Thanks
 
You can use ReadFile/WriteFile for windows. Unfortunately, I've no experience with port communication, so that's all I can tell you...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top