How do I access hardware on a Win-XP laptop?

N

news reader

I am learning how to read/write the RS232 port of my laptop.
First step is to just test the COM addresses.. (I know it can be found
in the hardware profile)..

Dev-C++ complains access violation/segmentation fault on that line..

I have Norton AV and Seagate Personal Firewall.. Do they affect?


Quote:
#include <stdio.h>
#include <dos.h>

int main()
{
unsigned int *ptraddr; /* Pointer to location of Port Addresses
*/
unsigned int address; /* Address of Port */
int a;

ptraddr=(unsigned int *)0x00000400;

for (a = 0; a < 4; a++)
{
address = *ptraddr;
if (address == 0)
printf("No port found for COM%d \n",a+1);
else
printf("Address assigned to COM%d is %Xh\n",a+1,address);
*ptraddr++;
}
return(0);
 
J

John Harrison

news said:
I am learning how to read/write the RS232 port of my laptop.
First step is to just test the COM addresses.. (I know it can be found
in the hardware profile)..

Dev-C++ complains access violation/segmentation fault on that line..

I have Norton AV and Seagate Personal Firewall.. Do they affect?


Quote:
#include <stdio.h>
#include <dos.h>

int main()
{
unsigned int *ptraddr; /* Pointer to location of Port Addresses
*/
unsigned int address; /* Address of Port */
int a;

ptraddr=(unsigned int *)0x00000400;

for (a = 0; a < 4; a++)
{
address = *ptraddr;
if (address == 0)
printf("No port found for COM%d \n",a+1);
else
printf("Address assigned to COM%d is %Xh\n",a+1,address);
*ptraddr++;
}
return(0);

This is not a C++ question, it is a Windows programming question, try
comp.os.ms-windows.programmer.win32 instead. You are off topic here.

john
 
N

news reader

This is not a C++ question, it is a Windows programming question, try
comp.os.ms-windows.programmer.win32 instead. You are off topic here.

john

correct, i am looking into CreateFile...etc. now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top