84 API Command Reference
Personal488 User's Manual For Windows95 and Windows NT
OnEventVDM
Syntax
INT WINAPI OnEventVDM(DevHandleT devHandle, EventFuncT func);
devHandle
refers to either an interface or an external device.
func
is a user-specified interrupt-handler function that is to perform some user-defined
function, when one of the
Arm
ed conditions occur.
Returns
-1
if error
Mode
Any
Bus States
None
Example
Arm(ieee0, acSRQ);
OnEventVDM(ieee0, srqHandler);
Arms
SRQ
detection and sets up
SRQ
function handler
See Also
OnEvent, Arm, Disarm
This function is new in Driver488/W95 and in Driver488/WNT. The
OnEventVDM
(
VDM
refers to
Virtual DOS Machine) allows a call back to a user-specified function in a console mode application.
The following is a full example of a console mode program using the
OnEventVDM
function:
#include <windows.h>
#include <stdio.h>
#include “iotieee.h”
// For debugging
#define qsk(v,x) (v=x, printf(#x “returned %d/n”, v))
void
srqHandler(DevHandlerT devHandle, UINT mask)
{
LONG xfered;
printf(“\007\n\nEVENT-FUNCTION on %d mask 0x%04x\n”,
devHandle, mask);
qsk(xfered, Spoll(devHandle));
printf(“\n\n”);
}
void
main(void)
{
LONG result, xfered;
int ioStatus, x;
DevHandleT ieee0, wave14, wave16;
TermT myTerm;
UCHAR buffer[500];
printf(“\n\nSRQTEST program PID %d\n”,GetCurrentProcessId ());
qsk(ieee0, OpenName(“ieee0”));
qsk(wave14, OpenName(“Wave14”));
qsk(wave16, OpenName(“Wave16”));
qsk(result, Abort(wave14));
qsk(result, Abort(wave16));
qsk(x, Hello(ieee0, buffer));
printf(“\n%s\n\n”, buffer);
myTerm.EOI = 1;
myTerm.nChar = 0;
myTerm.termChar[0] = ‘\r’;
myTerm.termChar[1] = ‘\n’;
// Arm SRQ detection and set up SRQ function handler
qsk(x, Arm(ieee0, acSRQ));
qsk(x, OnEventVDM(ieee0, srqHandler));
// Tell the Wave to assert SRQ in 3 seconds
qsk(xfered,Output(wave16,“t3000x”,6L,1,0,&myTerm,0,&ioStatus));
printf(“Completion code: 0x%04x\n”, ioStatus);
Summary of Contents for OMB-PER-488/W95
Page 1: ......
Page 4: ...ii Personal488 User s Manual For Windows 95 and Windows NT Notes...
Page 38: ...32 Personal488 with GP488B Personal488 User s Manual For Windows95 and Windows NT Notes...
Page 52: ...46 Driver488 W95 Driver488 WNT Personal488 User s Manual For Windows95 and Windows NT Notes...
Page 136: ...130 Appendix Personal488 User s Manual For Windows95 and Windows NT Notes...
Page 139: ...Personal488 User s Manual For Windows 95 and Windows NT Index 133 Notes...
Page 142: ...136 Abbreviations Personal488 User s Manual For Windows95 and Windows NT Notes...