[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

529.0. "MACRO Problem(s)" by BOOTIS::BAILEY (The Pursuit Of _Knowledge_) Tue Apr 04 1989 09:36

Any idea what I doing wrong here ???

I'am trying to call  QueryTree from macro, the program (extract below)
complies and links fine, but gives me a 

%SYSTEM-F-ACCVIO, access violation, reason mask=04, virtual address=00000000, 
PC=000918A7, PSL=03C000002

when it calls  QueryTree, The Window & Display Id's returned look
fine to me (the Window ID is the same as shown by one of the Tree display
programs from the Examples Conf)


; Open the display connection to the DECwindows server
	pushl	#0			;display name is NULL
	calls	#1,g^XOpenDisplay	;open the display connnection
	movl	R0,Display		;save screen number



	pushl	Display			; display argument
	calls	#1,g^XDefaultScreen	; get default screen number
	movl	R0,Screen		; save it


	pushl	Screen			; screen number
	pushl	Display			; display
	calls	#2,g^XRootWindow	; get root window
	movl	R0,Window		; save it


	pushal	window			
	pushal	display
	calls	#2,g^XQueryTree


The Complie/Link command  was

$ mac  'p1'+xlibdef/lib+xlibdef/lib
$ link 'p1',sys$input/opt
        sys$share:decw$xlibshr/share





Any idea whats wong



Peter  (I must get on a C course)   Bailey

T.RTitleUserPersonal
Name
DateLines
529.1There are no optional argumentsSTAR::BRANDENBERGIntelligence - just a good party trick?Tue Apr 04 1989 12:0212
    
    Can't say as I can read this macro stuff but :-) ...
    
    you have two problems.  First, XQueryTree's display and window
    arguments are pass-by-value not pass-by-reference so replace
    pushal with pushl.  Second, XQueryTree has six arguments, not
    two and short changing this call isn't going to make you friends.
    Add the remaining arguments (root_return, parent_return,
    children_return, and nchildren_return {all by reference}).
    
    					m

529.2It Works, It Works hahahahaBOOTIS::BAILEYThe Pursuit Of _Knowledge_Tue Apr 04 1989 12:5318
>you have two problems.  First, XQueryTree's display and window
>arguments are pass-by-value not pass-by-reference so replace

Well acording to my manual all the arguments are pass-by-reference


> .  Second, XQueryTree has six arguments, not
> two and short changing this call isn't going to make you friends.

Again acording to my manual you must give display & window_id
but the others are  'vax only optional'


Having said that if I do it as suggested it seems to work


Thanks for the answers (thought I was cracking up   :-)

529.3STAR::BRANDENBERGIntelligence - just a good party trick?Tue Apr 04 1989 13:1012
    
    Remember, there are two bindings: C and VAX.  The example you gave used
    C bindings called from Macro so I assumed that's what you wanted.  Your
    comments suggest you meant to use the VAX bindings, easily recognizable
    by that Americentic character: '$'.  I suppose I could agree that an
    argument like  XQueryTree( Display *display ... ) is pass-by-reference
    ( display.mr.r ) but the way it is used in an application is more of an
    address passed by value ( display.ra.v ) and that's why I say
    pass-by-value.
    
    					m

529.4LESLIE::LESLIEAndy ��� Leslie, CSSETue Apr 04 1989 13:313
    If the documentation is unclear, I suggest you submit a QAR and/or post
    a note in BULOVA::VMS_DOCUMENTATION....

529.5BOOTIS::BAILEYThe Pursuit Of _Knowledge_Tue Apr 04 1989 17:2314
>    Remember, there are two bindings: C and VAX.  The example you gave used
>    C bindings called from Macro so I assumed that's what you wanted.  Your

_no_ what I WANTED to do was get my head straight before coding,
take 1000 lines.... read the documentation before coding


Thanks for the help (I think I'am going to need all the help
I can get)

Ta

Peb