[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

3721.0. "callback routine problem" by GLORY::MATERNA () Tue Nov 27 1990 17:41

    The following code is part of a strip chart program I am creating.  I
    am having trouble with the callback routines, however.  In this segment
    of code, I define a callback procedure named PDME_ACTIVATE for a
    pull-down menu.  In the PDME_ACTIVATE callback routine, I need to check
    the TAG parameter, but I'm getting access vio's when performing any
    operations with TAG. The WIDGET and REASON parameters are passed
    correctly, though.  I figure I'm defining the callback routine wrong.
    
    I'd appreciate any help in locating the problem.
    
    
    Bill
    
    
    
    
    
     
    
    
	PROGRAM strip_chart
	IMPLICIT NONE


	INCLUDE 'SYS$LIBRARY:DECW$XLIBDEF'
	INCLUDE 'SYS$LIBRARY:DECW$DWTDEF'

	EXTERNAL pdme_activate

	RECORD /dwt$callback/ callback_struct(2)
	RECORD /dwt$drmreg_arg/ callback_arglist(5)
	RECORD /dwt$arg/ arglist(0:25)

		.
		.
		.


!  Create pull down menu for menu bar

	callback_struct(1).dwt$a_callback_proc = %LOC(pdme_activate)
	callback_struct(1).dwt$l_callback_tag = 1
	callback_struct(2).dwt$a_callback_proc = 0

	CALL dwt$vms_set_arg (
	1   dwt$c_orientation_vertical,
	2   arglist,
	3   0,
	4   dwt$c_norientation)

	CALL dwt$vms_set_arg (
	1   %LOC(callback_struct(1).dwt$a_callback_proc),
	2   arglist,
	3   1,
	4   dwt$c_nentry_callback)

	argcount = 2
	commands_widget = dwt$menu_pulldown_create(menu_bar_widget, !parent
	1				   'Commands', 		    !name
	2				   arglist,		    !arguments
	3				   argcount)

		.
		.
		.

	CALL xt$main_loop

	END


********************************************************************************


	SUBROUTINE pdme_activate (widget, tag, reason)
	IMPLICIT NONE
	

	INTEGER*4	widget,tag,reason
    
	    .
	    .
	    .
    
	RETURN

	END
T.RTitleUserPersonal
Name
DateLines
3721.1problem foundGLORY::MATERNAWed Nov 28 1990 11:0414
    I found my mistake.
    
    .
    .
    one = 1
    callback_struct(1).dwt$l_callback_tag = %LOC(one)
    .
    .
    
    
    Dwt$l_callback_tag is the address, not the value.
    
    
    Bill