Hello. Can anybody convert this C coding to VB? This coding is to read location to obtain addresses of my printer port. Also , i have this algorithm so that when my IR sensor is triggered, (connected to parallel port in my PC) it will also triggered my web camera to capture picture(connected to usb port) but i dont know how to write it in VB. Thanks in advance

The C coding need to convert to VB
#include <stdio.h>
#include <dos.h>

void main (void)
{
unsigned int far *ptraddr ; /*pointer to location of Port Adress*/
unsigned int address ; /* adress of port*/
int a:

ptraddr=(unsigned int far *) 0x00000408;

for (a=0;a<3;a++)
{
address = *ptraddr;
if (address ==0)
printf ("No port found for LPT5d \n, a+1);
else
printf ( "Adress assigned to PLT&d is %Xh\n", a+1, address);
*ptraddr++;
}
}

The algo needed to write in VB

Initialize base address, pin...etc

Read the parallel port
Is Bit0 = 0 /*If yes, loop again upper line and this line
/*If No, continue

Read parallel port
Is Bit0=1 /*If yes, loop again this statement
/*If no continue

Initiate code to detect camera
Make camera capture picture

End