comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: object reference in a structure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: object reference in a structure [message #12843] Fri, 18 September 1998 00:00
Charlie Solomon is currently offline  Charlie Solomon
Messages: 10
Registered: September 1998
Junior Member
Thank you for the help, I'm now up and running...Charlie
Re: object reference in a structure [message #12857 is a reply to message #12843] Thu, 17 September 1998 00:00 Go to previous message
Vap User is currently offline  Vap User
Messages: 31
Registered: April 1998
Member
"Charlie Solomon" <crsolomon@west.raytheon.com> writes:

>
> Hi everyone...is it possible to put an object reference in a structure
> variable? For example, I create a new object, then create a pointer to an
> info structure for my widget and try to include the object reference in the
> structure:
>
> junk = 'charlie was here'
> ptr_new, info( { junk:junk, oWindow:0 } )
>

Imminently doable. The thing you must store in the structure is a null object
reference. You get one in a way analogous to how you get a null
pointer reference, i.e. with Obj_New(). Try...

Widget_Control, widget_id_where_you_want_to_store_this_info, $
set_UValue=Ptr_New( { junk:junk, oWindow: Obj_new() } )

Then everything else will work fine. I do this sort of thing all the time.


>
> But when I try to access it bad things happen (I can get the actual error
> message if needed). Here's how I try to access it:
>
> (*info).oWindow = obj_new('IDLgrWindow') ;no worky
> (*info).oWindow -> method, keywords ;no worky
>
> Should I even be trying this? I want to be able to store the object
> reference in info after it is created in another procedure and passed back
> so that my widget program can modify properties and destroy it based on
> xmanager events. Thanks!
>
>

--
I don't speak for JPL, it doesn't speak for me.
Well, not all the time, at least.
William Daffer <vapuser@haifung.jpl.nasa.gov>
Re: object reference in a structure [message #12890 is a reply to message #12857] Tue, 15 September 1998 00:00 Go to previous message
Phillip &amp; Suzanne is currently offline  Phillip &amp; Suzanne
Messages: 31
Registered: June 1998
Member
Charlie Solomon wrote:

;> Hi everyone...is it possible to put an object reference in a structure
;> variable? For example, I create a new object, then create a pointer to an
;> info structure for my widget and try to include the object reference in the
;> structure:

;> junk = 'charlie was here'
;> ptr_new, info( { junk:junk, oWindow:0 } )

Try this:

junk='charlie was here'
ptr_new, info({junk:junk, oWindow:Obj_New()} )

;> But when I try to access it bad things happen (I can get the actual error
;> message if needed). Here's how I try to access it:

;> (*info).oWindow = obj_new('IDLgrWindow') ;no worky
;> (*info).oWindow -> method, keywords ;no worky

;> Should I even be trying this? I want to be able to store the object
;> reference in info after it is created in another procedure and passed back
;> so that my widget program can modify properties and destroy it based on
;> xmanager events. Thanks!

The problem really turns out to be one of data types. An IDL object reference
is not a short integer. I believe it is a long integer, but Obj_New() returns
a null object reference that is definitely the correct type. Once this is set
up, I believe you'll be in great shape.

Phillip
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: test
Next Topic: Re: Setting ranges on surfaces

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 01:18:53 PDT 2025

Total time taken to generate the page: 0.00481 seconds