Simple Application

  • Thread starter Thread starter TerryW
  • Start date Start date
T

TerryW

Hello,

I am trying to write a simple application that will look at a hardware
address lets say &HA400 or &H378 approximately 1000 times per second.

Every 100th time though I need to write out the value to the registry
(any place will work).

Is ms Vc++ appropriate for this kind of application? If not, can
someone point me to the right newsgroup? If so, does anyone have any
examples or hardware drivers or registry writing?

Thanks In Advance,

Terry
 
TerryW @vbssys.com> said:
I am trying to write a simple application that will look at a hardware
address lets say &HA400 or &H378 approximately 1000 times per second.

Every 100th time though I need to write out the value to the registry
(any place will work).

Is ms Vc++ appropriate for this kind of application? If not, can
someone point me to the right newsgroup? If so, does anyone have any
examples or hardware drivers or registry writing?

You don't specify the target platform. That's a key bit of information
required to answer the question.

All of the 32 bit Windows operating systems restrict access by 32 bit
applications to the machine's I/O ports to device drivers so that only they
are allowed such low-level access. '95, ''98 and Millennium may permit
access by 16 bit programs as a concession to DOS compatibility.

So, yes, if you are willing to write a device driver you can use VC++. I
believe that the device driver kit (DDK) includes a copy of the compiler. In
any event this link

http://www.microsoft.com/whdc/devtools/ddk/default.mspx

explains how to get the DDK. Alternatively, you can invest in a toolkit with
its own driver for access to the ports. You might want to ask for
suggestions in a device driver group.

As for the '9x platforms, well the recent editions (last 6 or 8 years or so)
of MS compilers do NOT provide the ability to build 16 bit applications. You
could not use them to craft a 16 bit hack. Of course, you could use the 32
bit DDK for the target '9x platform to do the job.

Regards,
Will
 
Thanks for your post Will,

The target is 32bit windows operating system.
I have seen an example from another source that looks like this...

hdriver = CreateFile("\\\\.\\hwinterface", GENERIC_READ | GENERIC
WRITE,0,NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL);

subsequently,

error = DeviceIoControl(hdriver, IOCTL_WRITE_PORT_UCHAR, &Buffer,
3,NULL,0,&BytesReturned,NULL);

Do you think that something like this will work?

I am really curious what \\\\.\\hwinterface does.

Thanks in advance,
Terry
 
TerryW @vbssys.com> said:
Thanks for your post Will,

You are welcome.
The target is 32bit windows operating system.
I have seen an example from another source that looks like this...

hdriver = CreateFile("\\\\.\\hwinterface", GENERIC_READ | GENERIC
WRITE,0,NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL);

subsequently,

error = DeviceIoControl(hdriver, IOCTL_WRITE_PORT_UCHAR, &Buffer,
3,NULL,0,&BytesReturned,NULL);

Do you think that something like this will work?

I could be wrong but I think that this along the lines of the "toolkit"
option that I mentioned. In other words, a third party provides a device
driver which does the low level port I/O (which by the way needs to be
installed by an administrator) and a high level interface for you to call
via CreateFile() and DeviceIOControl().
I am really curious what \\\\.\\hwinterface does.

A quick google search of microsoft.com for IOCTL_WRITE_PORT_UCHAR came up
empty. I did get a hit on a third party site. I think you will need to
contact the them.

Regards,
Will
 
Back
Top