Solved

Interruptions (Visual C++ 4.2)

Posted on 1997-03-03
4
244 Views
Last Modified: 2013-12-03
I have to control an own ISA card. I have programmed interruptions with BC++ but I tryed with VC++ but it didn't work. I tryed with C files.

I want to know what instructions I have to use and what options I have to choose when I compile.
0
Comment
Question by:jcordon
  • 2
4 Comments
 
LVL 3

Expert Comment

by:sperling
ID: 1334187
Is this win16, win95 or win nt? You cannot control HW inside an user-mode Win32 app, you'll need to write a VxD(95) or driver(NT)
0
 

Author Comment

by:jcordon
ID: 1334188
I'm working with windows 95.
Are you sure that this is the only way?

Can't I use rutines like in BC++ :
For example with "interrupt" , "intdosx" or something like that.
0
 

Author Comment

by:jcordon
ID: 1334189
I'm working with windows 95.
Are you sure that this is the only way?

Can't I use rutines like in BC++ :
For example with "interrupt" , "intdosx" or something like that.
0
 
LVL 2

Accepted Solution

by:
amartin030297 earned 100 total points
ID: 1334190
You are approaching your problem from a DOS perspective rather than Windows (err.. "User", "Client", or "Ring3").

What you are executing when you build a win32 application is
running is "User" space.  The whole concept of directly controlling interrupts doesn't apply to you. (Oh my God you say!). But when you think about it, what if someone starts
say.... two or three instances of your app! Or worse, what if
someone is sharing that interrupt w/you.

The answer? Well-- since you're using Windows 95, you'll need
to write a VxD (much more simple/documented than writing an
NT Driver IMHO).  I recommend you purchase either the MS Device Driver Kit, or but Vireo's VToolsD (www.vireo.com) for about $400.

So-- what happens is your VxD (which is just simple C or C++ code if you buy Vireo-- I wrote and I/O trapper in minutes!) actually traps the hardware interrupt, and virtualizes I/O's to your ISA card address (See VIOPort using Vireo).  Then whenever your "User" app (be or Dos or win32!) accesses the port, or uses DeviceIOCTL (just a call into your VxD), you setup a statemachine for that Virtual Machine (which is just a unique ID (err...pointer)) for whatever process sent whatever command.  Thus you can have multiple apps using your device, OR, you can not grant access to other processes when someone has "Opened" the device.. its your decision.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now