Solved

Interruptions (Visual C++ 4.2)

Posted on 1997-03-03
4
246 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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 video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 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

16 Experts available now in Live!

Get 1:1 Help Now