![Omega OMB-PER-488/W95 User Manual Download Page 89](http://html1.mh-extra.com/html/omega/omb-per-488-w95/omb-per-488-w95_user-manual_4058772089.webp)
Personal488 User's Manual For Windows 95 and Windows NT
API Command Reference 83
OnEvent
Syntax
INT WINAPI OnEvent(DevHandleT devHandle, HWND hWnd, OpaqueP
lParam);
devHandle
refers to either an interface or an external device.
hWnd
is the window handle to receive the event notification.
lParam
value will be passed in the notification message.
Returns
-1
if error
Mode
Any
Bus States
None
Example
ieee = OpenName (“ieee”);
OnEvent (ieee, hWnd, (OpaqueP) 12345678L);
Arm (ieee, acSRQ | acError);
break;
See Also
OnEventVDM, Arm, Disarm
The
OnEvent
command causes the event handling mechanism to issue a message upon occurrence of
an
Arm
ed event. The message will have a type of
WM_IEEE488EVENT
, whose value is retrieved via:
RegisterWindowMessage ((LPSTR) “WM_IEEE488EVENT”);
The associated
wParam
is an event mask indicating which
Arm
ed event(s) caused the notification, and
the
lParam
is the value passed to
OnEvent
. Note that although there is a macro for
WM_IEEE488EVENT
in the header file for each language, this macro resolves to a function call and
therefore cannot be used as a case label. The preferred implementation is to include a default case in
the message handling case statement and directly compare the message ID with
WM_IEEE488EVENT
.
The following is a full example of a program using the
OnEvent
function:
LONG FAR WINAPI export
WndProc(HWND hWnd, unsigned iMessage, WORD wParam, LONG lParam);
{
HANDLE
ieee;
switch (iMessage)
{
case WM_CREATE:
ieee = OpenName (“ieee”);
OnEvent (ieee, hWnd, (OpaqueP) 12345678L);
Arm (ieee, acSRQ | acError);
break;
default:
if (iMessage == WM_IEEE488EVENT) {
char buff [80];
wsprintf (buff, “Condition = %04X,
Param = %081X”,wParam, lParam);
MessageBox (hWnd, (LPSTR) buff,
(LPSTR) “Event Noted”, MB OK);
return TRUE;
}
}
}
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...